WorksheetsIT club - Quize
Total questions: 12
Worksheet time: 14mins
Which keyword is used to define a constant in C?
static
final
const
constant
Which of the following is not a valid variable name in C?
total_marks
_value
float
sum1
Which statement about variables inside a function is true?
They are global by default
They are local to that function
They cannot be static
They can only store integers
Which function is used to compare two strings in C?
strcopy()
strcmp()
strcomp()
compare()
What is the default value of a local variable in C?
0
Null
Garbage value
-1
What does the continue statement do in a loop?
Terminates the program
Skips the current iteration
Restarts the program
Exits from the loop
Which of the following cannot be used with switch statement?
int
char
float
Enum
What is the output of this code?
int a = 5;
printf("%d %d", a, a++);
5 5
5 6
6 5
Undefined / unspecified
Which operator is used to get the address of a variable?
@
*
&
%
What will be the result of dividing any integer by zero in C?
0
Infinity
Compile-time error or runtime crash
Undefined but continues
#include <stdio.h>
int main()
int i = 0;
while (Missing Logic) {
i += 2;
printf("%d ", i);
}
return 0;
}
Output: 2 4 6 8 10
(a)
What is the output of the following code?
#include <stdio.h>
int main() {
char ch = 'A';
printf("%c", ch + 1);
return 0;
}
(a)
