Explore topic-wise MCQs in C Programming.

This section includes 66 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.

51.

Is it true that a function may have several declarations, but only one definition?

A. Yes
B. No
Answer» B. No
52.

Point out the error in the following program. #include struct emp { char name[20]; int age; }; int main() { emp int xx; int a; printf("%d\n", &a); return 0; }

A. Error: in printf
B. Error: in emp int xx;
C. No error.
D. None of these.
Answer» C. No error.
53.

1 : typedef long a;extern int a c; 2 : typedef long a;extern a int c; 3 : typedef long a;extern a c;

A. 1 correct
B. 2 correct
C. 3 correct
D. 1, 2, 3 are correct
Answer» D. 1, 2, 3 are correct
54.

Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.

A. Yes
B. No
Answer» C.
55.

What is the output of the program? #include int main() { extern int a; printf("%d\n", a); return 0; } int a=20;

A. 20
B. 0
C. Garbage Value
D. Error
Answer» B. 0
56.

Which of the following operations are INCORRECT?

A. int i = 35; i = i%5;
B. short int j = 255; j = j;
C. long int k = 365L; k = k;
D. float a = 3.14; a = a%3;
Answer» E.
57.

Which of the following is correct about err used in the declaration given below? typedef enum error { warning, test, exception } err;

A. It is a typedef for enum error.
B. It is a variable of type enum error.
C. The statement is erroneous.
D. It is a structure.
Answer» B. It is a variable of type enum error.
58.

Which of the declaration is correct?

A. int length;
B. char int;
C. int long;
D. float double;
Answer» B. char int;
59.

By default a real number is treated as a

A. float
B. double
C. long double
D. far double
Answer» C. long double
60.

Is there any difference in the following declarations? int myfun(int arr[]);int myfun(arr[20]);

A. Yes
B. No
C. Yes
D. No
Answer» B. No
61.

Point out the error in the following program (if it is compiled with Turbo C compiler). #include int main() { display(); return 0; } void display() { printf("IndiaBIX.com"); }

A. No error
B. display() doesn't get invoked
C. display() is called before it is defined
D. None of these
Answer» D. None of these
62.

A long double can be used if range of a double is not enough to accommodate a real number.

A. 1
B.
C. 1
D.
Answer» B.
63.

How would you round off a value from 1.66 to 2.0?

A. ceil(1.66)
B. floor(1.66)
C. roundup(1.66)
D. roundto(1.66)
Answer» B. floor(1.66)
64.

When we mention the prototype of a function?

A. Defining
B. Declaring
C. Prototyping
D. Calling
Answer» C. Prototyping
65.

What is the output of the program given below ? #include int main() { enum status { pass, fail, atkt}; enum status stud1, stud2, stud3; stud1 = pass; stud2 = atkt; stud3 = fail; printf("%d, %d, %d\n", stud1, stud2, stud3); return 0; }

A. 0, 1, 2
B. 1, 2, 3
C. 0, 2, 1
D. 1, 3, 2
Answer» D. 1, 3, 2
66.

Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun();

A. Both are identical
B. No difference, except extern int fun(); is probably in another file
C. int fun(); is overrided with extern int fun();
D. None of these
Answer» C. int fun(); is overrided with extern int fun();