What will the following programs print in while loop? Use char to control while loop - C Statement

C examples for Statement:while

Description

What will the following programs print in while loop? Use char to control while loop

Demo Code

#include <stdio.h> 

int main(void) 
{ 
    char ch; /*from   ww  w  .  j  ava 2  s .  c  o m*/
 
    scanf("%c", &ch); 
    
    while ( ch != 'g' ) 
    { 
         printf("%c", ++ch); 
         scanf("%c", &ch); 
    } 
    return 0; 
}

Result


Related Tutorials