C Data Types 2 Questions and Answers

Take Exam

C Data Types questions with answers help learners understand how data is stored, manipulated, and used in C programming. Data types form the foundation of C as they define the type of data a variable can hold, such as int, float, char, or double. Mastering C data types is essential for students preparing for placement exams or programming interviews at companies like TCS, Infosys, and Wipro. This topic often features in C programming MCQs and technical test questions that evaluate understanding of memory allocation, data precision, and type conversions. Practice these programming questions and answers to strengthen your core knowledge and prepare for real-world coding challenges.

Understand various data types in C. Study C structures and dynamic memory allocation

C Data Types 2

Showing 10 of 159 questions

121. The number of bytes of storage occupied by short, int and long int are

  • 2, 2 and 4
  • 2, 4 and 4
  • 4, 4 and 4
  • Machine dependent
Show Answer Report

122. Find the output void main ( ) { int a; char b; float c; printf ("%d", sizeof (a+sizeof(b+c)))); }

  • 2
  • 1
  • 4
  • Compilation error
Show Answer Report

123. Find the output int main (void) { int x=256; if(*(char *) &x = =255 { printf(Little Endian\n"); } return 0; }

  • Big Endian
  • Little Endian
  • Compilation error
  • None of these
Show Answer Report

124. Find the output. void main ( ) [ printf ("%d",~1^~0); }

  • -2
  • 1
  • 0
  • -1
Show Answer Report

125. Find the output. int main ( ) { unsigned val=0xabcd; if(va>>16|val<<16) { printf ("success")); } return exit (0); printf ("Failure"); }

  • No output
  • Success
  • Failure
  • SuccessFailure
Show Answer Report

126. Find the output. void main ( ) { int x=4; printf("%d",printf ("%d%d", x+1, x)); }

  • 5 4 5
  • 4 4 5
  • 5 4 2
  • 4 4 2
Show Answer Report

127. Find the output. void main ( ) { int x=-5u; int y=5; y=y>x?y/x:x/y; printf("%u", y); }

  • 13106
  • -1
  • 65535
  • 5
Show Answer Report

128. Find the output. void main ( ) { int i=5; prntf ("%dcef"+1, i) +1; }

  • 15ceg
  • %dceg
  • dceg
  • ceg
Show Answer Report

129. Find the output. void main ( ) { unsigned val=0xfff; if(~val) printer ("%d", val); printf ("%d", ~val); }

  • -1 0
  • -1
  • 0
  • Compilation error
Show Answer Report

130. When a tab key is pressed how much memory is reserved for it?

  • 2 byte
  • 8 bytes
  • Depends on the memory model
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test