Home > C Programming > Quizzes > C Programming Fundamentals Test
C Programming Fundamentals Test
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 6% Most missed: “How can you access the first element of an array called 'arr'?”
C Programming Fundamentals Test
Time left 00:00
25 Questions

1. What is the output of the following program: #include void main() { int j - k=10 - l=-20 - a=8 - b=4; j = --k - ++l * b / a; printf('Z= %d \n' - j); }
2. Which of the following is not a predefined variable type?
3. What is the difference between fopen and open?
4. Is C Object Oriented?
5. int tab[3] = {0 - 1 - 2}; int i = 0; tab[++i] == ?
6. What is the output of the following code: char str[10] = 'abcd'; char * p1 - *p2; p1 = str; p2 = str; *p2 = 'A'; printf ( '%s %s' - p1 - p2 );
7. What will be the output? main() { float a=1.1; double b=1.1; if(a==b) printf('True'); else printf('False'); }
8. Is this code valid in C89? #define RED '\033[31m' #define END '\033[0m' puts('Hello ' RED 'world' END ' !');
9. What is the value of i after : int i; i = 10; i = i++ + i++;
10. What will be the output of: #include void main() { char a[6] = 'Hello'; printf('%d' - sizeof(a)); }
11. How many '-' will be printed out by running the following code: #include #include #include int main(void) { int i; for(i=0; i<2; i++){ fork(); printf('-\n'); } return 0; }
12. What is meaning of following declaration? int(*p[3])();
13. Currently - what does GCC stand for?
14. Will this loop terminate? int x=10; while( x-- > 0 );
15. What does the following do? int j = 10; while (j --> 0){ printf('%d ' - j); }printf('\n');
16. Which of these is NOT correct syntax?
17. With: sizeof(char *) == 4 sizeof(char) == 1 What will sizeof(plop) for char plop[2][3] be?
18. #ifdef __APPLE__ # include #else # include #endif What does it mean?
19. int a = 1 - b; a = 1 & b = 2; what's the result of a and b?
20. with sizeof(char) == 1 sizeof(char *) == 4 char *a - *b; a = b; b++; What is (b - a)?
21. What does '11 | 4 == 15' evaluate to?
22. #include int main(){ char *string='smarterer'; printf('%d' - printf('%s' - string)); return 0; } What is the output?
23. Does 'gcc -Wall' print all warnings?
24. Which one is a reserved keyword?
25. Which of the following special symbols are allowed in a variable name?