1 - C Lang - MCQ
1 - C Lang - MCQ
d) Analyzing data
a) C
b) Python
c) Assembly
d) Java
Answer: c) Assembly
a) //
b) #
c) /*
d) """
Answer: a) //
a) int
b) float
c) char
d) double
Answer: a) int
a) 4 bytes
b) 2 bytes
c) 8 bytes
b) int
c) float
d) double
Answer: a) char
a) var
b) constant
c) const
d) static
Answer: c) const
a) 1 byte
b) 2 bytes
c) 4 bytes
Answer: a) 1 byte
10. Which data type is used to store real numbers with single precision in C?
a) float
b) double
c) long double
d) real
Answer: a) float
a) 4 bytes
b) 8 bytes
c) 2 bytes
Answer: a) 4 bytes
12. Which data type is used to store real numbers with double precision in C?
a) float
b) double
c) long double
d) real
Answer: b) double
a) 4 bytes
b) 8 bytes
c) 2 bytes
Answer: b) 8 bytes
14. What is the range of values that can be stored in an 'int' data type?
a) -32768 to 32767
b) 0 to 65535
c) -2147483648 to 2147483647
d) -128 to 127
a) my variable
b) _count
c) 3nums
d) double
Answer: b) _count
a) &
b) *
c) $
d) #
Answer: a) &
17. Which of the following is a correct way to declare and initialize a variable in C?
a) int num;
b) var num;
c) num = 10;
```c
int x = 5;
printf("%d", x++);
```
a) 4
b) 5
c) 6
Answer: b) 5
int a = 10, b = 3;
float result = a / b;
printf("%f", result);
```
a) 3.333333
b) 3.000000
c) 3.666667
d) 3
Answer: b) 3.000000
20. Which header file is required to perform input and output operations in C?
a) <stdio.h>
b) <iostream.h>
c) <io.h>
d) <inputoutput.h>
Answer: a) <stdio.h>
```c
int num = 7;
```
a) 3.5
b) 3.0
c) 3
d) 2.5
Answer: c) 3
a) boolean
b) bool
c) int
d) char
Answer: b) bool
```c
char ch = 'A';
printf("%c", ch + 1);
```
a) A
b) B
c) C
a) char
b) int
c) string
d) character
Answer: a) char
```c
int x = 10, y = 5;
printf("%d", x % y);
```
a) 2
b) 5
c) 0
d) 1
Answer: c) 0
a) function
b) method
c) fun
d) void
Answer: d) void
d) To declare a variable
```c
int x = 5;
printf("%d", ++x);
```
a) 4
b) 5
c) 6
Answer: c) 6
29. Which of the following is a correct way to declare a constant pointer in C?
a) 4 bytes
b) 8 bytes
c) 16 bytes
Please note that these questions are for educational purposes and may vary based on the C