ExamVeda
Login
Home
31
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    while (l1: i < 2)
    {
        i++;
        while (j < 3)
        {
            printf("loop\n");
            goto l1;
        }
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
32
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    while (i < 2)
    {
        l1 : i++;
        while (j < 3)
        {
            printf("Loop\n");
            goto l1;
        }
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
33
What is an example of iteration in C?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
34
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 5, k;
    if (i == 0)
        goto label;
        label: printf("%d", i);
        printf("Hey");
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
35
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    for (int i = 0;i < 1; i++)
        printf("In for loop\n");
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0;
    for (; ; ;)
        printf("In for loop\n");
        printf("After loop\n");
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3)?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    for (i; i < 2; i++){
        for (j = 0; j < 3; j++)
        {
            printf("1\n");
            break;
        }
        printf("2\n");
    }
    printf("after loop\n");
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
39
Comment on the output of the following C code.
#include <stdio.h>
int main()
{
    int a = 1;
    switch (a)
    case 1:
        printf("%d", a);
    case 2:
        printf("%d", a);
    case 3:
        printf("%d", a);
    default:
        printf("%d", a);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 1, b = 1;
    switch (a)
    {
       case a*b:
          printf("yes ");
       case a-b:
          printf("no\n");
          break;
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board