Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- signed int insize=sizeof(int)*8-1; //2^n-1 -1
- long long in_size=pow(2,insize);
- printf("Range of signed int -%lld to %lld\n",in_size,in_size-1);
- unsigned int insize1=sizeof(int)*8;
- long long in_size1=pow(2,insize1)-1;
- printf("Range of unsigned int 0 to %lld\n\n",in_size1);
- int chsize=sizeof(char)*8-1;
- long long ch_size=pow(2,chsize);
- printf("Range of Signe Char -%lld to %lld\n\n",ch_size,(ch_size-1));
- int chsize1=sizeof(char)*8;
- long long ch_size1=pow(2,chsize1)-1;
- printf("Range of unsinged Char 0 to %lld\n\n",ch_size1);
- int flosize=sizeof(float)*8-1;
- long long flo_size=pow(2,flosize);
- printf(" Ranges of float -%lld to %lld\n\n",flo_size,flo_size-1);
- long long int doubsize=sizeof(double)*8;
- printf("Ranges of double %lld bits\n",doubsize);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement