Witer a program to Represent integer constants.

We rarely use octal and hexadecimal numbers in programming. The largest integer value that can be stored in machine-dependent. It is 32767 on 16-bit machines and 2,147,483,647 on 32-bit machines.


#include <stdio.h>
main()
{
printf("Integer values\n");
printf("%d%d%d\n", 32767,32767+1,32767+10);
printf("\n");
printf("Long integer values\n\n");
printf("%ld%ld%ld\n", 32767L, 32767L+1L, 32767L+10L);
return 0;
}


Output:

Integer values

32767 -32768 -32759

Long integer values

32767 32768 32777

No comments:

Post a Comment