Advertisement
AJTAMjid2000

Untitled

Jun 13th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5.        signed int insize=sizeof(int)*8-1;    //2^n-1 -1
  6.         long long in_size=pow(2,insize);
  7.     printf("Range of  signed  int  -%lld   to    %lld\n",in_size,in_size-1);
  8.     unsigned int insize1=sizeof(int)*8;
  9.     long long in_size1=pow(2,insize1)-1;
  10.     printf("Range of unsigned  int  0  to  %lld\n\n",in_size1);
  11.  
  12.     int chsize=sizeof(char)*8-1;
  13.     long long ch_size=pow(2,chsize);
  14.  
  15.     printf("Range of Signe Char  -%lld  to    %lld\n\n",ch_size,(ch_size-1));
  16.     int chsize1=sizeof(char)*8;
  17.     long long ch_size1=pow(2,chsize1)-1;
  18.     printf("Range of unsinged Char    0    to    %lld\n\n",ch_size1);
  19.     int  flosize=sizeof(float)*8-1;
  20.     long long flo_size=pow(2,flosize);
  21.     printf(" Ranges of float   -%lld  to   %lld\n\n",flo_size,flo_size-1);
  22.    long long int doubsize=sizeof(double)*8;
  23.  
  24.     printf("Ranges of double  %lld bits\n",doubsize);
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement