This question is about the C program(NOT C++ program)
Please write the C program to find out the largest and the smallest number in 32bits
For example ,the smallest number in 32 bits is -2147483648
Code
#include <stdio.h>
#define BITSCOUNT 32
int main()
{
int min, max;
printf("Minimum value of 32-bit signed
integer\n");
min = (pow(2, BITSCOUNT) / 2) * -1;
printf("%d\n", min);
printf("Maximum value of 32-bit signed
integer\n");
max = (pow(2, BITSCOUNT) / 2) - 1;
printf("%d\n", max);
return 0;
}
Test Output
Get Answers For Free
Most questions answered within 1 hours.