- Question: Which of the following is the correct syntax to declare an integer variable in C?
- A) int x;
- B) x integer;
- C) integer x;
- D) declare x as integer;
- Answer: A) int x;
- Question: What will be the output of the following code snippet?
#include<stdio.h>
int main() {
printf("%d", sizeof(int));
return 0;
}
- A) 2
- B) 4
- C) 8
- D) Depends on the system architecture
- Answer: D) Depends on the system architecture
- Question: What does the ‘void’ keyword indicate in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: Which operator is used to access the value at the address stored in a pointer variable?
- A) *
- B) &
- C) ->
- D) ::
- Answer: A) *
- Question: What will be the output of the following code snippet?
#include<stdio.h>
int main() {
int x = 5;
int *ptr = &x;
printf("%d", *ptr);
return 0;
}
- A) 5
- B) Address of x
- C) Garbage value
- D) Compilation Error
- Answer: A) 5
- Question: Which of the following is NOT a valid data type in C?
- A) float
- B) double
- C) string
- D) long
- Answer: C) string
- Question: What will be the output of the following code snippet?
#include<stdio.h>
int main() {
int x = 5, y = 10;
printf("%d", x++ + ++y);
return 0;
}
- A) 15
- B) 16
- C) 17
- D) 20
- Answer: B) 16
- Question: Which of the following is NOT a valid identifier in C?
- A) myVar
- B) 123var
- C) _myVar
- D) $myVar
- Answer: B) 123var
- Question: What will be the output of the following code snippet?
#include<stdio.h>
int main() {
int x = 5, y = 10;
x += y;
printf("%d", x);
return 0;
}
- A) 5
- B) 10
- C) 15
- D) 20
- Answer: C) 15
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 5, y = 10; printf("%d", (x > y) ? x : y); return 0; }
- A) 5
- B) 10
- C) 15
- D) Compilation Error
- Answer: B) 10
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; if (x == 5 && x == 10) printf("True"); else printf("False"); return 0; }
- A) True
- B) False
- C) Compilation Error
- D) Runtime Error
- Answer: B) False
- **
Question:** What is the purpose of the ‘continue’ statement in C?
– A) To terminate a loop.
– B) To skip the current iteration of a loop.
– C) To exit a function.
– D) To break out of a switch statement.
– Answer: B) To skip the current iteration of a loop.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 10; printf("%d", x++); return 0; }
- A) 10
- B) 11
- C) 9
- D) Compilation Error
- Answer: A) 10
- Question: Which function is used to allocate memory dynamically in C?
- A) malloc()
- B) calloc()
- C) realloc()
- D) All of the above
- Answer: D) All of the above
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; if (x = 10) printf("True"); else printf("False"); return 0; }
- A) True
- B) False
- C) Compilation Error
- D) Runtime Error
- Answer: A) True
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x--); return 0; }
- A) 5
- B) 4
- C) 6
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘do-while’ loop in C?
- A) To execute a block of code while a condition is true.
- B) To execute a block of code at least once, then repeat as long as a condition is true.
- C) To execute a block of code a fixed number of times.
- D) To exit a loop.
- Answer: B) To execute a block of code at least once, then repeat as long as a condition is true.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i; for (i = 0; i < 5; i++) { if (i == 2) continue; printf("%d ", i); } return 0; }
- A) 0 1 2 3 4
- B) 0 1 3 4
- C) 1 2 3 4
- D) 0 1 2 3
- Answer: B) 0 1 3 4
- Question: What is the purpose of the ‘while’ loop in C?
- A) To execute a block of code while a condition is true.
- B) To execute a block of code at least once, then repeat as long as a condition is true.
- C) To execute a block of code a fixed number of times.
- D) To exit a loop.
- Answer: A) To execute a block of code while a condition is true.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; while (x > 0) { printf("%d ", x); x--; } return 0; }
- A) 5 4 3 2 1
- B) 1 2 3 4 5
- C) 0
- D) Compilation Error
- Answer: A) 5 4 3 2 1
- Question: What is the purpose of the ‘switch’ statement in C?
- A) To execute a block of code while a condition is true.
- B) To execute a block of code at least once, then repeat as long as a condition is true.
- C) To execute one of many blocks of code based on the value of an expression.
- D) To exit a loop.
- Answer: C) To execute one of many blocks of code based on the value of an expression.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { char grade = 'A'; switch (grade) { case 'A': printf("Excellent"); break; case 'B': printf("Good"); break; case 'C': printf("Average"); break; default: printf("Fail"); } return 0; }
- A) Excellent
- B) Good
- C) Average
- D) Fail
- Answer: A) Excellent
- Question: What is the purpose of the ‘continue’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: B) To skip the current iteration of a loop.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i = 0; while (i < 5) { printf("%d ", i); i++; } return 0; }
- A) 0 1 2 3 4
- B) 1 2 3 4 5
- C) 0 1 2 3
- D) Compilation Error
- Answer: A) 0 1 2 3 4
- Question: What is the purpose of the ‘do-while’ loop in C?
- A) To execute a block of code while a condition is true.
- B) To execute a block of code at least once, then repeat as long as a condition is true.
- C) To execute a block of code a fixed number of
- D) To exit a loop.
- Answer: B) To execute a block of code at least once, then repeat as long as a condition is true.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i = 0; do { printf("%d ", i); i++; } while (i < 5); return 0; }
- A) 0 1 2 3 4
- B) 1 2 3 4 5
- C) 0 1 2 3
- D) Compilation Error
- Answer: A) 0 1 2 3 4
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i; for (i = 0; i < 5; i++) { if (i == 2) break; printf("%d ", i); } return 0; }
- A) 0 1
- B) 0 1 2
- C) 0 1 3 4
- D) Compilation Error
- Answer: A) 0 1
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i; for (i = 0; i < 5; i++) { if (i == 2) return 0; printf("%d ", i); } return 0; }
- A) 0 1
- B) 0 1 2
- C) 0 1 3 4
- D) Compilation Error
- Answer: A) 0 1
- Question: What is the purpose of the ‘continue’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: B) To skip the current iteration of a loop.
- Question: What will be the output of the following code snippet?
#include<stdio.h> int main() { int i; for (i = 0; i < 5; i++) { if (i == 2) continue; printf("%d ", i); } return 0; }
- A) 0 1
- B) 0 1 2
- C) 0 1 3 4
- D) Compilation Error
- Answer: C) 0 1 3 4
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
c #include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.
- Question: What is the purpose of the ‘return’ statement in C?
- A) To terminate a loop.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To break out of a switch statement.
- Answer: C) To exit a function.
- Question: What is the output of the following code snippet?
#include<stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- A) 5
- B) 6
- C) 10
- D) Compilation Error
- Answer: A) 5
- Question: What is the purpose of the ‘sizeof’ operator in C?
- A) To return the size of a variable in bytes.
- B) To return the address of a variable.
- C) To return the value stored in a variable.
- D) To allocate memory for a variable.
- Answer: A) To return the size of a variable in bytes.
- Question: What is the purpose of the ‘void’ keyword in a function declaration in C?
- A) It indicates that the function returns nothing.
- B) It indicates that the function takes no arguments.
- C) It indicates that the function is not defined.
- D) It indicates that the function is static.
- Answer: A) It indicates that the function returns nothing.
- Question: What is the purpose of the ‘break’ statement in C?
- A) To terminate a loop or switch statement.
- B) To skip the current iteration of a loop.
- C) To exit a function.
- D) To continue to the next iteration of a loop.
- Answer: A) To terminate a loop or switch statement.
- Question: What is the purpose of the ‘default’ keyword in a switch statement in C?
- A) It is used to define a default case.
- B) It is used to exit the switch statement.
- C) It is used to specify the initial value of a variable.
- D) It is used to define the last case.
- Answer: A) It is used to define a default case.