ExamVeda
Login
Home
61
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0;
    while (i < 2)
    {
        if (i == 1)
            break;
            i++;
            if (i == 1)
                continue;
                printf("In while loop\n");
    }
    printf("After loop\n");
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
62
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 0, k;
    label: printf("%d", i);
    if (i == 0)
        goto label;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
63
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 97;
    switch (x)
    {
       case 'a':
          printf("yes ");
          break;
       case 97:
          printf("no\n");
          break;
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
64
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int *p = NULL;
    for (foo(); p; p = 0)
        printf("In for loop\n");
        printf("After loop\n");
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
65
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    printf("%d ", 1);
    goto l1;
    printf("%d ", 2);
    l1:goto l2;
    printf("%d ", 3);
    l2:printf("%d ", 4);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
66
The keyword 'break' cannot be simply used within . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
67
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 0;
    if (x == 1)
        if (x == 0)
            printf("inside if\n");
        else
            printf("inside else if\n");
    else
        printf("inside else\n");
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include <stdio.h>
void main()
{
    char *ch;
    printf("enter a value between 1 to 3:");
    scanf("%s", ch);
    switch (ch)
    {
       case "1":
          printf("1");
          break;
       case "2":
          printf("2");
          break;
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
69
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    l1: while (i < 2)
        {
            i++;
            while (j < 3)
            {
                printf("loop\n");
                goto l1;
            }
        }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
70
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 0;
    if (x == 0)
        printf("true, ");
    else if (x = 10)
        printf("false, ");
    printf("%d\n", x);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board