What will the following programs print in for loop? - C Statement

C examples for Statement:for

Description

What will the following programs print in for loop?

Demo Code

#include <stdio.h> 

int main(void) 
{ 
    char ch; /*from  www .j  a v a  2s .c  o  m*/
 
    scanf("%c", &ch); 
    for ( ch = '$'; ch != 'g'; scanf("%c", &ch) ) 
          printf("%c", ch); 
    return 0; 
}

Result


Related Tutorials