LOOP
#include <iostream.h>
main()
{
//declare variable
//get input
cout <<"enter an integer = ";
cin >> x;
//loop for
for (y=0;y<x;y++)
{
cout <<" "<<x;
}
WHILE
#include <iostream.h>
main()
int x.y;
cout<<"enter an integer =";
cin>>x;
//while
y=1;
while (y<x)
{
cout <<" "<<x;
y++;
}
}
final project
13 years ago
0 comments:
Post a Comment