Signed and unsigned integer in C language by R4R Team

Signed Integer :

Syntax-
int variable;

Range:-32,768 to 32,767

Unsigned Integer:


Syntax-
unsigned int variable;

Range:0 to 65,535

Why unsigned Integer ?

-For increase the range of the integer.


program-

#include< stdio.h>
int main()
{
int i=20;
unsigned int j=4;
printf("%d\n",i);
printf("%d",j);
}


output-

20
4

Note:range of integer variable may be varies depends on the compiler.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!