Question Bank For ISE2025SemII
Question Bank For ISE2025SemII
5. What happens if the loop condition in a while loop is always true and there is no
break?
A) It runs once
B) It gives a compile-time error
C) It causes an infinite loop
D) It exits automatically after some time
6. Which of the following is a valid reason to use the break statement inside a loop?
A) To skip the next iteration
B) To immediately stop the entire loop execution
C) To jump to a different function
D) To reset loop variables
7) What will be the output of the following code?
main ( )
int i;
for (i = 0; i < 5; i++) {
if (i == 3)
break;
printf ("%d ", i);
}
A) 0 1 2 3
B) 0 1 2
C) 0 1 2 3 4
D) 1 2 3
8) Which of the following loop in C checks the condition after executing the loop
body?
A) for
B) while
C) do-while
D) All of above
main( )
int i = 0;
while (i < 5)
{
if (i == 3)
continue;
printf ("%d ", i);
i++;
}
A)1 2 3 4 5
B) 1 2 4 5
C) 0 1 2 4 5
D) 1 2 3 5
9. Which keyword is used to transfer control out of a loop unconditionally?
A) continue
B) break
C) return
D) All of these
A) n
B) n - 1
C) 0
D) 1
main( )
A) 10
B) 15
C) 20
D) 25
A) int a[3];
B) int a[3] = {1, 2, 3};
C) int a[ ];
D) int a = {1, 2, 3};
14. What is the correct way to declare a 1D array of 10 integers?
A) int arr[10];
B) int[10] arr;
C) arr int[10];
D) int arr = [10];
main()
A) 10
B) 15
C) 20
D) 5
18. What will be the output of the code below?
main()
int i = 0;
do {
i++;
A) 0 1 2
B) 1 2 3
C) 0 1 2 3
D) Infinite loop
main()
int i = 1;
do {
A) 0 1 2
B) 1 2 3
C) 0 1 2 3
D) Infinite loop