
C programming
Quiz by Shayan Saiyed
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
15 questions
Show answers
- Q1What is the output of the following code: printf("%d", 5 + 2 * 3);91110830s
- Q2What is the size of an 'int' type variable in C on a typical 32-bit system?1 byte8 bytes2 bytes4 bytes30s
- Q3Which 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
- Q4What is the correct syntax to declare a variable of type int in C?int a =;int a;int = a;a int;30s
- Q5Which 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
- Q6What 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
- Q7What 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
- Q8Which operator is used for equality comparison in C?======#30s
- Q9What is the purpose of the 'break' statement in a loop in C?It continues to the next iterationIt terminates the loop immediately.It restarts the loop from the beginningIt pauses the loop for a moment30s
- Q10What 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 onceIt creates a functionIt initializes a variable30s
- Q11What 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
- Q12What does the following statement do: int a = 5; a++;Resets a to 0Assigns the value 6 to aIncrements the value of a by 1Decrements the value of a by 130s
- Q13Which operator is used for logical AND in C programming?&&&|||30s
- Q14What 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
- Q15What is the output of the following code snippet: 'printf("%d", 10 + 5);'?1051510530s