#include<stdio.h> main() { int a=3,b=2; float c; c=(float)a/b; printf("Result is %f",c); }
Result is 1.500000
#include<stdio.h> main() { int a=100; char b='a'; printf("size of int %d",sizeof(a)); printf("size of char %d",sizeof(b)); printf("size of float %d",sizeof(float)); }
size of int 2 or 4 size of char 1 size of float 4
#include<stdio.h> const float pi=3.14; main() { int r; float a,c; printf("Enter Radius "); scanf("%d",&r); a=pi*r*r; c=2*pi*r; printf("Area is %f",a); printf("\nCircumference is %f",c); }
Enter Radius 5 Area is 78.500000 Circumference is 31.400002
main() { printf("%d",Wed); } Output : 2
main() { enum days day; day = SUN; printf("%d", day ) ; } Output : 11
#include<stdio.h> #define pi 3.14 main() { int r; float a,c; printf("Enter Radius "); scanf("%d",&r); a=pi*r*r; c=2*pi*r; printf("Area is %f",a); printf("Circumference is %f",c); }
Enter Radius 2 Area is 12.560000 Circumference is 12.560000