C

A visually engaging scene featuring a programmer working at a desk filled with C programming books, code snippets on the screen, and a coffee cup, conveying a sense of focus and learning.

Master C Programming Quiz

Test your knowledge of C programming with our engaging quiz! This quiz consists of 10 carefully crafted questions that cover various aspects of the C language, ranging from basic syntax to advanced concepts.

Get ready to challenge yourself and improve your programming skills!

  • Multiple choice questions
  • Instant feedback on answers
  • Perfect for programmers of all levels
10 Questions2 MinutesCreated by CodingWizard42
1. Which of the following library function is not case-sensitive?
A) toupper()
B) tolower()
C) isdigit()
D) all of the mentioned

2. Comment on the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char *a = {"p", "r", "o", "g", "r", "a", "m"};
  5.         printf("%s", a);
  6.     }
A) Output will be program
B) Output will be p
C) No output
D) Compile-time error
3. The correct way to generate numbers between minimum and maximum(inclusive) is _________________
A) minimum + (rand() % (maximum – minimum));
B) minimum + (rand() % (maximum – minimum + 1));
C) minimum * (rand() % (maximum – minimum))
D) minimum – (rand() % (maximum+minimum));

4. What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int a[4] = {1, 2, 3, 4};
  5.         int b[4] = {1, 2, 3, 4};
  6.         int n = &b[3] - &a[2];
  7.         printf("%d\n", n);
  8.     }
A) -3
B) 5
C) 4
D) Compile time error
5. Advantage of a multi-dimension array over pointer array.
A) Pre-defined size.
B) Input can be taken from user.
C) Faster Access.
D) All of the mentioned

6. What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct p
  3.     {
  4.         int x;
  5.         char y;
  6.         struct p *ptr;
  7.     };
  8.     int main()
  9.     {
  10.         struct p p = {1, 2, &p};
  11.         printf("%d\n", p.ptr->x);
  12.         return 0;
  13.     }
A) Compile time error
B) Undefined behaviour
C) 1
D) 2

7. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <ctype.h>
  3.     int main()
  4.     {
  5.         if (isspace('n'))
  6.             printf("space\n");
  7.         else
  8.             printf("not space\n");
  9.             return 0;
  10.     }
A) Compile time error
B) space
C) not space
D) None of the mentioned

8. What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         int I = 0;
  6.         for (i = 0;i < 10; i++)
  7.         printf("%s", a[i]);
  8.     }
A) hi hello how Segmentation fault
B) hi hello how null
C) hey hello how Segmentation fault
D) hi hello how followed by 7 nulls

9. What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct student
  3.     {
  4.     };
  5.     void main()
  6.     {
  7.         struct student s[2];
  8.         printf("%d", sizeof(s));
  9.     }
A) 2
B) 4
C) 8
D) 0
10. What happens when we use fprintf(stderr, “error: could not open filen”);
A) The diagnostic output is directly displayed in the output.
B) The diagnostic output is pipelined to the output file.
C) The line which caused error is compiled again.
D) The program is immediately aborted.
{"name":"C", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of C programming with our engaging quiz! This quiz consists of 10 carefully crafted questions that cover various aspects of the C language, ranging from basic syntax to advanced concepts.Get ready to challenge yourself and improve your programming skills!Multiple choice questionsInstant feedback on answersPerfect for programmers of all levels","img":"https:/images/course1.png"}
Powered by: Quiz Maker