C examples for Statement:while
What will the following program print for nesting switch into while loop?
#include <stdio.h> int main(void) { int i = 0; //w w w . j a v a 2s.c om while ( i < 3) { switch(i++) { case 0 : printf("fat "); case 1 : printf("hat "); case 2 : printf("cat "); default: printf("Oh no!"); } putchar('\n'); } return 0; }