Tuesday, May 30, 2017

While Loop Show

#include<iostream>
using namespace std;
int main()
{
int n,i;
cout <<"Enter Number: ";
cin>>n;
i=1;
while(i<=n)
{

cout <<"Show: "<<i<<endl;
i++;
}
return 0;
}

Do While Show

#include<iostream>
using namespace std;
int main()
{
int n,i;
cout <<"Enter Number: ";
cin>>n;
i=1;
do
{
cout <<"Excecut "<<i<<" Time\n";
i++;
}while (i<=n);
return 0;
}

For Loop Show

#include<iostream>
using namespace std;
int main()
{
int n,i;
cout <<"Enter Number: ";
cin>>n;
for(i=1;i<=n;i++)
{

cout<<"Execute "<<i<<" Time"<<endl;
}


return 0;
}