a) do-while b) if-else c) for d) while Answer: b
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
if (i == 3)
break;
}
}
What will be the output of the following C code? #include < stdio.h >
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}
What will be the output of the following C code? #include < stdio.h >
View QuestionWhich keyword can be used for coming out of recursion?
a) break b) return c) exit d) both break and return Answer: b
View QuestionWhich loop is most suitable to first perform the operation and then test the condition?
a) for loop b) while loop c) do-while loop d) none of the mentioned Answer: c
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
}
printf(“%d, %d\n”, i, j);
}
What will be the output of the following C code? #include < stdio.h >
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int i = 0;
while (i = 0)
printf(“True\n”);
printf(“False\n”);
}
What will be the output of the following C code? #include < stdio.h >
View Question
How many times while loop condition is tested in the following C code snippets, if i is initialized to 0 in both the cases?
while (i < n)
i++;
————-
do
i++;
while (i <= n);
How many times while loop condition is tested in the following C code snippets, if i is initialized ...
View QuestionWhat is an example of iteration in C?
a) for b) while c) do-while d) all of the mentioned Answer: d
View Question
What will be the output of the following C code?
#include < stdio.h >
void main()
{
int i = 0;
while (i < 10)
{
i++;
printf(“hi\n”);
while (i < 8)
{
i++;
printf(“hello\n”);
}
}
}
What will be the output of the following C code? #include < stdio.h > void main() { ...
View Question