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
131. Find the output. void main ( ) { char c=65; c=(!=c); printf("%d",c); }
- 0
- 65
- 2
- Compilation error
132. Find the output. void main ( ) { char not=65; not=not + (not =!not); printf("%d',not); }
- 0
- 65
- 1
- 66
133. Find the output. void main ( ) { char p[ ]="%d\n"; p[1]='c'; printf ("%s", p, 65); }
- %d
- %c
- A
- %s
134. Find the output void main ( ) { unsigned int i; for (i=1; i>-2; i--) printf("a"); }
- aaa
- aa
- No output
- Compilation error
135. Find the output void main ( ) { unsigned int i; for (i=1; i>-2; i--) printf ("a"); }
- aaa
- aa
- No output
- Compilation error
136. Find the output void main ( ) { signed char i=1; for (;i>0;i++); printf ("%d",i); }
- 127
- 128
- -128
- infinite loop
137. Find the output. #define sizeof (int) 3 #define float int void main ( ) { float a; if(a=sizeof (int) / sizeof (float)) if (a==1.00000) printf("Testing"); printf("OK"); }
- No output
- OK
- Testing
- Testing OK
138. Find the output void main( ) int a=256; char *p=&a; *++p=2; printf("%d", a); }
- 512
- 258
- Compilation error
- None of these
139. Find the output int main ( ) { float a=12.5; printf("%f\n",a); printf ('%f", *(int *) &a); return 0;
- 12.500000 0.000000
- 12.500000 12.500000
- 0.000000 12.500000
- None of these
140. Find the output void main ( ) { char ch ='A'; ch=-100-91; printf("%c", ch); }
- f
- A
- a
- None of these