500 views
0 votes
0 votes
Write a program to determine the ranges of char, short, int, and long variables, both signed and unsigned, by printing appropriate values from standard headers and by direct computation. Harder if you compute them: determine the ranges of the various floating-point types.

1 Answer

0 votes
0 votes

Header file would be limits.h

CHAR_BIT= number of bits allocated to char.

CHAR_MIN=minimum value of char.

CHAR_MAX= maximum value of char.

similarly INT_MIN/MAX, LONG_MIN/MAX can be used

for  unsigned  you can use  UCHAR_MAX, UINT_MAX ..

here is source code written by me but first you try.

click here

Related questions

0 votes
0 votes
0 answers
1
srestha asked Aug 11, 2018
239 views
Bit fields use for padding.It generally contained integer bits(signed and unsigned). But it cannot contain addresses. Does it mean bit field cannot contain a pointer ?Whe...