0% found this document useful (0 votes)
136 views16 pages

Which of The Following Data Type Is Right in C: Programming?

The document contains 9 multiple choice questions about C programming concepts like data types, operators, precedence, and output of code snippets. The questions cover topics such as valid data types in C, syntax errors in enum declarations, equality comparisons of float and double, pointer sizes, pre-increment and post-decrement operators, logical NOT operator, and output of code using these concepts.

Uploaded by

Charan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views16 pages

Which of The Following Data Type Is Right in C: Programming?

The document contains 9 multiple choice questions about C programming concepts like data types, operators, precedence, and output of code snippets. The questions cover topics such as valid data types in C, syntax errors in enum declarations, equality comparisons of float and double, pointer sizes, pre-increment and post-decrement operators, logical NOT operator, and output of code using these concepts.

Uploaded by

Charan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

1.

Which of the following data type is right in C


programming?

A. long long double


B. unsigned long long int
C. long double int
D. unsigned long double
2. Which one of the following is incorrect?

A. enum fruits = { apple, banana }f;


B. enum fruits{ apple, banana }f ;
C. enum fruits{ apple, banana };
D. enum f{ apple, banana };
3. What will be the output of the C program?

#include<stdio.h>
int main()
{
float me = 5.25;
double you = 5.25;
if(me == you)
printf("I love U");
Else
printf("I hate U");
return 0;
}
A. Compilation error
B. I love U
C. Runtime error
D. I hate U
4. What will be the output of the C
program ?
#include<stdio.h>
int main()
{
char *ptr;
printf("%d %d", sizeof(*ptr), sizeof(ptr));
return 0;
}
A. 2 4
B. 4 4
C. 1 4
D. 1 2
5. What will be the output of the C
program?
#include<stdio.h>
int main()
{
int i = 5;
int a = ++i + ++i;
printf("%d",a);
return 0;
}
• A. 14
• B. 13
• C. 12
• D. 11
6. What will be the output of the C
program?
#include<stdio.h>
int main()
{
int i = 5;
int a = ++i + ++i + ++i;
printf("%d",a);
return 0;
}
A. 24
B. 23
C. 21
D. 22
7. What will be the output of the C
program?
#include<stdio.h>
int main()
{
int i = 16;
i =! i > 15;
printf("i = %d",i);
return 0;
}
A. 16
B. 1
C. 0✔
D. Compilation error
8. What will be the output of the C
program?
#include<stdio.h>
int main()
{
int i = 5;
int a = --i + --i;
printf("%d",a);
return 0;
}
A. 8
B. 5
C. 7
D. 6
9. What will be the output of the C
program?
#include<stdio.h>
int main()
{
int i = 5;
int a = --i + --i + --i;
printf("%d",a);
return 0;
}
A. 8
B. 9
C. 7
D. 6

You might also like