Tuesday, 9 December 2014

C Program to view the difference between data types

Program to view the difference between data types
#include<stdio.h>
#include<string.h>
main()
{
int a=10,b=22,c;
printf("a=%d b=%d c=%d\n",a,b,c=(a+b));
printf("a=%d b=%f c=%f\n",a,b,c=(a+b));
printf("a=%f b=%f c=%f\n",a,b,c=(a+b));
printf("a=%d b=%d c=%d\n",a,b,c=(a+b));
}
OutPut:
enter values for a and b
10
20
a=10 b=20 c=30
a=10 b=0.000000 c=0.000000
a=0.000000 b=0.000000 c=0.000000
a=10 b=20 c=30