#include <stdio.h> #include <stdlib.h> #include <stdbool.h> int main() { int i1; printf("i1=%d\n",i1); i1 = 5; printf("i1=%d\n",i1); i1 = -3; printf("i1=%d\n",i1); i1 = 3.5; printf("i1=%d\n",i1); double d1 = 3.5; printf("d1=%lf\n",d1); d1=0; printf("d1=%lf\n",d1); float f1 = 3.7; printf("f1=%f\n",f1); char c = 'A'; printf("%c\n",c); c=65; printf("%c\n",c); int code ='A'; printf("%d\n\n",code); _Bool b=0; printf("b=%d\n",b); b=1; printf("b=%d\n",b); b=2; printf("b=%d\n",b); b=-1; printf("b=%d\n",b); b=false; printf("using keywords b=%d\n",b); b=true; printf("using keywords b=%d\n\n",b); char name[]="Tharaka Weerasena"; printf("%s\n",name); int x = sizeof (int); printf("number of bytes of an int:%d bytes\n",x); printf("number of bits:4*8=32 bits\n"); printf("we can store 2^32 in an integer"); //429496796 system("pause"); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter