placeholder image to represent content

C programming

Quiz by Shayan Saiyed

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    What is the output of the following code: printf("%d", 5 + 2 * 3);
    9
    11
    10
    8
    30s
  • Q2
    What is the size of an 'int' type variable in C on a typical 32-bit system?
    1 byte
    8 bytes
    2 bytes
    4 bytes
    30s
  • Q3
    Which of the following correctly uses a 'for' loop in C to iterate from 1 to 5?
    for(int i = 1; i < 5; i++) {}
    for(int i = 1; i <= 5; i++) {}
    for i = 1 to 5 {}
    for(int i = 1; i <= 5; i-- ) {}
    30s
  • Q4
    What is the correct syntax to declare a variable of type int in C?
    int a =;
    int a;
    int = a;
    a int;
    30s
  • Q5
    Which of the following is a correct way to declare an array of integers in C?
    int arr[10];
    int arr(10);
    arr int[10];
    int[10] arr;
    30s
  • Q6
    What will happen if you try to access an array index that is out of bounds in C?
    An error message will be displayed.
    The program will automatically correct it.
    It may result in undefined behavior.
    The array will resize automatically.
    30s
  • Q7
    What does the 'sizeof' operator do in C?
    It checks the value of a variable.
    It allocates memory for a variable.
    It returns the size, in bytes, of a data type or variable.
    It initializes a variable.
    30s
  • Q8
    Which operator is used for equality comparison in C?
    ===
    =
    ==
    #
    30s
  • Q9
    What is the purpose of the 'break' statement in a loop in C?
    It continues to the next iteration
    It terminates the loop immediately.
    It restarts the loop from the beginning
    It pauses the loop for a moment
    30s
  • Q10
    What does the 'while' loop do in C programming?
    It repeats a block of code as long as a condition is true.
    It executes code only once
    It creates a function
    It initializes a variable
    30s
  • Q11
    What is the correct way to declare a function in C that returns an integer and takes two integer parameters?
    function int myFunction(int a, int b);
    int myFunction(a, b) int;
    void myFunction(int a, int b);
    int myFunction(int a, int b);
    30s
  • Q12
    What does the following statement do: int a = 5; a++;
    Resets a to 0
    Assigns the value 6 to a
    Increments the value of a by 1
    Decrements the value of a by 1
    30s
  • Q13
    Which operator is used for logical AND in C programming?
    &&
    &
    |
    ||
    30s
  • Q14
    What does the '#' symbol indicate when it appears at the beginning of a line in a C program?
    It comments out the line.
    It indicates the end of a statement.
    It denotes a preprocessor directive.
    It is used for variable declaration.
    30s
  • Q15
    What is the output of the following code snippet: 'printf("%d", 10 + 5);'?
    105
    15
    10
    5
    30s

Teachers give this quiz to your class