CSE MCQs :: C-MCQs
-
What is the output of this C code?
int main()
{
int i = 0;
do {
i++;
printf("In while loop\n");
} while (i < 3);
}
-
How many times i value is checked in the below code?
int main()
{
int i = 0;
do {
i++;
printf("in while loop\n");
} while (i < 3);
}
-
How many times i value is checked in the below code?
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loop\n");
}
-
What is the output of this C code?
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}
-
What is the output of this C code?
void main()
{
int i = 0;
while (++i)
{
printf("H");
}
}
-
What is the output of this C code?
void main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}
-
What is the output of this C code?
void main()
{
char *str = "";
do
{
printf("hello");
} while (str);
}
-
What is the output of this C code?
void main()
{
int i = 0;
while (i < 10)
{
i++;
printf("hi\n");
} while (i < 8)
i++;
printf("hello\n");
}
-
Number of times while loop condition is tested is, i is initialized to 0 in both case.
while (i < n)
i++;
-------------
do
i++;
while (i <= n);