[ create a new paste ] login | about

Link: http://codepad.org/GMWScwqK    [ raw code | output | fork ]

C, pasted on Aug 10:
1
2
3
4
5
6
7
8
9
10
11
#include<stdio.h>
#include<stdlib.h>
int main()
{
double flt = 71237.898;
char myfloat[50];
sprintf (myfloat, "%f", flt);  
double f = atof(myfloat); 
printf("answer is %f",f);
return 0;
}


Output:
1
answer is 71237.898000


Create a new paste based on this one


Comments: