Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0;
    char c = 'a';
    while (i < 2)
    {
        i++;
        switch (c) 
        {
           case 'a':
               printf("%c ", c);
               break;
               break;
        }
    }
    printf("after loop\n");
}

A. a after loop

B. a a after loop

C. after loop

D. error

Answer: Option B


This Question Belongs to C Program >> Control Structures

Join The Discussion

Related Questions on Control Structures