FREE TUTORIALS ON C programming

Sunday, January 26, 2014

Loops in c programming is a very exciting concept where we can write a repetetive code very easily


FOR LOOP:

#include<stdio.h>

int main()

{

   int a;

   for(a = 0 ; a < 5 ; a++)
{

  printf("hello world");

}
return 0;

}

WHILE LOOP:



#include<stdio.h>

int main()

{

   int a;

   while(a < 5)
{
   printf("hello world");
   a++;
}


return 0;

}


DO WHILE LOOP:


#include<stdio.h>

int main()

{

   int a;

   do
{
   
printf("hello world");



}

while( a < 5 );

return 0;

}


8:07 PM   Posted by Unknown with No comments

0 comments:

Post a Comment

Bookmark Us

Delicious Digg Facebook Favorites More Stumbleupon Twitter

Search