C Data Types 2 Questions and Answers
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
21. Which of the following is a valid character constant.
- '5'
- '\5'
- '\x5'
- All the above
22. When a type modifer is used by itself then it is assumped to be a type
- char
- float
- int void
24. Find the output 'void main ( ) { printf ("%d", (long double *) 200+1); }
- 208
- 210
- 212
- Depends on compiler
25. Find the output void main ( ) { printf ("%%d", 5); }
- 5
- %5
- %d
- None of these
26. Find the output. void main ( ) { char x=-130; char y=-5; printf ("%i", x+y); }
- -135
- -3
- 7
- 121
27. In a 16-bit O.S. every negative integer is stored in memory in the form of
- 2's complement of 16 data bits.
- 2's complement of 15 data bits.
- 1's complement of 16 data bits.
- None of these
28. Find the output void main ( ) { unsigned int x=500; int y=-5; if (x>y); printf ("hello"); else printf ("hi"); }
- hi
- hello
- compilation error
- None of these
29. Find the output void main ( ) { double y=2.4; float x=(float) y; printf ("%d%d", sizeof (x), sizeof (y)); }
- 4 4
- 4 8
- 8 8
- None of these
30. Find the output void man ( ) { unsigned char x=200; char y=140; printf (%d", x+y); }
- 213
- 84
- -84
- No output