Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Variables and Datatypes-2 MCQs

C Variables and Datatypes-2


1. Types of Integers are ______

a) short
b) int
c) long
d) All the above



2. What is the output of this program?
#include <stdio.h>

int main() {
  printf("%x",-1<<4);
  return 0;
}

a) fff0
b) fff1
c) fff2
d) fff3



3. The format identifier ‘%i’ is also used for _____ datatype?

a) char
b) int
c) float
d) double



4. Which data type is most suitable for storing a number 65000 in a 32-bit system?

a) short
b) int
c) long
d) double



5. Which of the following is a User-defined data type?

a) typedef int Boolean;
b) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
c) struct {char name[10], int age};
d) All of the mentioned



6. Range of signed char and unsigned char are?

a) -128 to +127, 0 to 255
b) 0 to 255, -128 to +127
c) -128 to -1, 0 to +127
d) 0 to +127, -128 to -1



7. Size of float, double and long double in Bytes are?

a) 4, 8, 16
b) 4, 8, 10
c) 2, 4, 6
d) 4, 6, 8



8. Range of float variable is?

a) -3.8e32 to +3.8e32
b) -3.4e34 to +3.4e34
c) -3.4e38 to +3.4e38
d) -3.2e38 to +3.2e38



9. Left most bit 0 in Singed representation indicates?

a) A Positive number
b) A Negative Number
c) An Unsigned number
d) None of the above



10. If you do not specify a storage class for a Variable?

a) You get compiler error
b) You get a compiler warning
c) Output is null always
d) None of the above



- Related Topics