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
111. Find the output. void main ( ) char i=1; for (i;i<127;i++) printf("Fll1"); }
- Prints Fool 127 times
- Prints Fool 126 times
- Prints Fool infinite times
- None of these
112. Find the output void main ( ) int x=32768; printf (%d %u", x, x); }
- -32768 32768
- 0 0
- 0 32768
- None of these
113. Find the output void main ( ) { unsigned int a=6; ~a; printf("%u", a); }
- 6
- 65529
- 65528
- 7
114. Find the output void main ( ) { int ch=48; if (ch) { printf("valid"); break; printf("ok") } else printf ("invalid"); }
- valid
- invalid
- No output
- Compilation error
115. Find the output. void main ( ) { int a:15; char b:7; printf("%d %d", sizeof (a), sizeof (b)); }
- 2 1
- 2 2
- 2 0
- Compilation error
116. Find the output void main ( ) { const int x=get( ); printf ("%d", x); } get ( ) { return (20); }
- 20
- 0
- Compilation error
- Garbage value
117. Find the output void main ( ) { printf ("%d %d", 85000); }
- 19464 0
- 19464 1
- 19464 garbage
- None of these
118. Find the output typedef struct boy { float height; char name;9; int age:16; } boy; void main ( ) { boy b={5 . 8, "Praveen kumar", 24}; printf("%f %s %d", b. height, b.name, b.age}; }
- 5.8 Praveen k24
- 5.8 Praveen kumar 24
- 5.8 Praveen k 16
- Compilation error
119. State the correct statement about external variables. (a) . (b) (c) (d)
- During declaration memory is allocated for external variables
- An external variable can be defined more than once.
- if a definition doesn't contain an initializer it is
- All of the above.
120. Find the output void main ( ) { int a; char b; float c; printer (%d", sizeof (a+b+c)); }
- 2
- 1
- 4
- 7