Monday, August 26, 2013

While Loop

Example 1:

//While Loop

#include<stdio.h>
int main()
{
int x=0;
int y=0;
while(x<=10)
{
y=y+x;
printf("%d\n",y);
x++;
}
return 0;
}



//Video Tutorial



Example 2:

#include<iostream>
using namespace std;
int main()
{
int x=0;
int y=0;
while(x<=10)
{
y=y+x;
cout<<y<<"\n";
x++;
}
return 0;
}


1 comment:

  1. This Website is Easy to Learn and usefull and my douts is remove after learn this website.

    ReplyDelete