What will the following program print in for loop? Mix printf statement in for - C Statement

C examples for Statement:for

Description

What will the following program print in for loop? Mix printf statement in for

Demo Code

#include <stdio.h> 
int main(void) 
{ 
   int k; //from w w  w . j  a v  a  2s .c om

   for(k = 1, printf("%d: Hi!\n", k); printf("k = %d\n",k), k*k < 26; k+=2, printf("Now k is %d\n", k) ) 
       printf("k is %d in the loop\n",k); 
   return 0; 
}

Result


Related Tutorials