The following code listing demonstrates all the available data types in the C programming language. I have tested the code in the Tiny C Compiler aka TCC.
main( )
{
int a; /* simple integer type */
long int b; /* long integer type */
short int c; /* short integer type */
unsigned int d; /* unsigned integer type */
char e; /* character type */
float f; /* floating point type */
double g; /* double precision floating point */
a = 1023;
b = 2222;
c = 123;
d = 1234;
e = ‘X’;
f = 3.14159;
g = 3.1415926535898;
printf(“a = %dn”,a); /* decimal output */
printf(“a = %on”,a); /* octal output */
printf(“a = %xn”,a); /* hexadecimal output */
printf(“b = %1dn”,b); /* decimal long output */
printf(“c = %dn”,c); /* decimal short output */
printf(“d = %un”,d); /* unsigned output */
printf(“e = %cn”,e); /* character output */
printf(“f = %fn”,f); /* floating output */
printf(“g = %fn”,g); /* double float output */
printf(“n”);
printf(“a = %dn”,a); /* simple int output */
printf(“a = %7dn”,a); /* use a field width of 7 */
printf(“a = %-7dn”,a); /* left justify in field of 7 */
printf(“n”);
printf(“f = %fn”,f); /* simple float output */
printf(“f = %12fn”,f); /* use field width of 12 */
printf(“f = %12.3fn”,f); /* use 3 decimal places */
printf(“f = %12.5fn”,f); /* use 5 decimal places */
printf(“f = %-12.5fn”,f); /* left justify in field */
}