Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    float f = 1;
    switch (f)
    {
       case 1.0:
          printf("yes\n");
          break;
       default:
          printf("default\n");
    }
}

A. yes

B. yes default

C. Undefined behaviour

D. Compile time error

Answer: Option D


This Question Belongs to C Program >> Control Structures

Join The Discussion

Related Questions on Control Structures