.
This commit is contained in:
22
bac2/os/chap0/ex5.c
Normal file
22
bac2/os/chap0/ex5.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
void print_type_stats();
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
print_type_stats();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void print_type_stats(){
|
||||
printf("int -> %.f\n", pow(2, (sizeof(int) * 8)));
|
||||
printf("uint -> %.f\n", pow(2, (sizeof(unsigned int) * 8)));
|
||||
printf("short -> %.f\n", pow(2, (sizeof(short) * 8)));
|
||||
printf("long -> %.f\n", pow(2, (sizeof(long) * 8)));
|
||||
printf("float -> %.f\n", pow(2, (sizeof(float) * 8)));
|
||||
printf("double -> %.f\n", pow(2, (sizeof(double) * 8)));
|
||||
|
||||
}
|
Reference in New Issue
Block a user