Thursday, 2 January 2014

A PROGRAM WITH FOR LOOP

An easy program for you...!!! Don't get panicked by difficult one's try this...!!!
Because simple programming always leads to complex one...!!!! Cheer-Up...!!! 


#include <stdio.h>
int main()
{
 int i=0;
 for(;i<=2;)
 printf(" %d\t%d\t%d\n",++i,i,i++);
return 0;
}

EXPECTED OUTPUT:

 2    2     0
 4    4     2
(Test your knowledge)

REMEMBER:  OUTPUT MIGHT VARY DEPENDING UPON YOUR COMPILER...!!! SO DON'T PANIC JUST GET THE BASIC CONCEPT OF i++ and ++i...!!! :)

No comments:

Post a Comment