- #include <stdio.h>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char *argv[]) {
- volatile float f;
- int i=36,j=25;
- char ch[10];
- sprintf(ch,"%d.%d",i,j);
- f=atof(ch);
- printf("\r\nk=%f",f);
- return 0;
- }
复制代码 |