Loops
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *S = "";
do
{
printf("Krishana");
} while (S);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
"Krishana" infinite times
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 0;
while (++k)
{
printf("Interview Mania");
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
"Interview Mania" infinite times
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 1;
do
{
printf("Interview Mania");
} while (k != 1);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
"Interview Mania" one time
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 4;
do
{
printf("Interview Mania\n");
} while (k < 3);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
"Interview Mania" one time
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 0;
while (k < 3)
{
k++;
printf("Hello\n");
while (k < 5)
{
k++;
printf("Interview Mania\n");
}
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Hello is printed 1 times, Interview Mania 4 times