[ create a new paste ] login | about

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

Rituparnadatta - C, pasted on Aug 15:
1
2
3
4
5
6
7
8
9
10
11
#include<stdio.h>
int main ()
{
double a, b, sum;
a=9.5;
b=8.743;
sum=a+b;
printf("sum is: %1f \n",sum);
printf("sum is: %0.2f \n",sum);
return 0;
}


Output:
1
2
sum is: 18.243000 
sum is: 18.24 


Create a new paste based on this one


Comments: