You are on page 1of 2

#include <iostream>

using namespace std;


void main()
{
int c = 1;
while (c <= 10)
{
cout << c << " - Welcome to IAP\n";
c++;
}
system("pause");
}

#include <iostream>
using namespace std;
void main()
{
int c = 1;
int n;
cout << "How many times: ";
cin >> n;
while (c <= n)
{
cout << c << " - Welcome to IAP\n";
c++;
}
system("pause");
}

#include <iostream>
using namespace std;
void main()
{
int ctr = 0;
while (ctr <= 10 )
{
cout << ctr << " - " << ctr * ctr << endl;
ctr = ctr + 1;
}
system("pause");
}

#include <iostream>
using namespace std;
void main()
{
int A,B;
cout << "Type the range please ";
cin >> A >> B;
int ctr = A;
while (ctr <= B )
{
cout << ctr << " - " << ctr * ctr << endl;
ctr = ctr + 1;
}
system("pause");
}

#include <iostream>
using namespace std;
void main()
{
int A,B;
cout << "Type the range please ";
cin >> A >> B;
if ( B < A )
{
int t ;
t = A;
A = B;
B = t;
}
int ctr = A;
while (ctr <= B )
{
cout << ctr << " - " << ctr * ctr << endl;
ctr = ctr + 1;
}

system("pause");
}

You might also like