C Questions March 18, 2023 | No Comments 0 votes, 0 avg 247 123456789101112131415 C Questions 1 / 15 1. What is the default return type if it is not specified in function definition? A. void B. int C. double D. short int 2 / 15 2. scanf() is a predefined function in______header file. A. stdlib. h B. ctype. h C. stdio. h D. stdarg. h 3 / 15 3. Is initialisation mandatory for local static variables? A. Yes B. No C. Depends on the compiler D. Depends on the standard 4 / 15 4. Choose facts about continue; statement is C Language. A. continue; is used to take the execution control to next iteration or sequence B. continue; statement causes the statements below it to skip for execution C. continue; is usually accompanied by IF statement. D. All the above. 5 / 15 5. Which statement is required to execute a block of code when the condition is false? A. for B. if C. else D. All of these 6 / 15 6. What will be the output of the following C code? #include struct student { int no = 5; char name[20]; }; void main() { struct student s; s.no = 8; printf("hello"); } A. Nothing B. Compile time error C. hello D. Varies 7 / 15 7. What is the output of C Program.? int main() { int a=0, b=0; while(++a < 4) printf("%d ", a); while(b++ < 4) printf("%d ", b); return 0; } A. 0 1 2 3 1 2 3 4 B. 1 2 3 1 2 3 4 C. 1 2 3 4 1 2 3 4 D. 1 2 3 4 0 1 2 3 8 / 15 8. What does the following program print? #include void f(int *p, int *q) { p = q; *p = 2; } int i = 0, j = 1; int main() { f(&i, &j); printf("%d %d n", i, j); getchar(); return 0; } A. 2 2 B. 2 1 C. 0 1 D. 0 2 9 / 15 9. Global variables are ____________ A. Internal B. External C. Both Internal and External D. None of the mentioned 10 / 15 10. What will be the output of the following C code? #include void main() { int i = 0; while (i < 10) { i++; printf("hin"); while (i < 8) { i++; printf("hellon"); } } } A. Hi is printed 8 times, hello 7 times and then hi 2 times B. Hi is printed 10 times, hello 7 times C. Hi is printed once, hello 7 times D. Hi is printed once, hello 7 times and then hi 2 times 11 / 15 11. What will be the output of the following C code? #include int *m(); void main() { int *k = m(); printf("hello "); printf("%d", k[0]); } int *m() { int a[2] = {5, 8}; return a; } A. Hello 5 8 B. Hello 5 C. hello followed by garbage value D. Compilation error 12 / 15 12. Which of the following is an exit controlled loop? A. While loop B. for loop C. Do-while loop D. none of the above 13 / 15 13. double ______ (double x, double y) computes the floating-point remainder of x/y. A. modf B. fmod C. ceil D. floor 14 / 15 14. Which of the following format specifiers is used to specify whether the given time is in AM or PM? A. %P B. %I C. %X D. %p 15 / 15 15. Choose a correct statement about C language break; statement. A. A single break; statement can force execution control to come out of only one loop. B. A single break; statement can force execution control to come out of a maximum of two nested loops. C. A single break; statement can force execution control to come out of a maximum of three nested loops. D. None of the above. Your score is The average score is 30% LinkedIn Facebook Twitter VKontakte 0% Restart quiz Questions, Quiz