CresHost
11-13-2006, 10:30 AM
Hello,
I need a little help . I want a program whose output is :
Enter a positive integer : 5
1
22
333
4444
55555
I know its gotta be done using for loops but can anyone help?
I have made so far:
#include<iostream.h>
#include<conio.h>
void main(void)
{
int x;
cout<<"Enter a positive integer ?";
cin>>x;
for ( int i=1; i<=x; i++ )
{
cout<<i<<endl;
}
getch();
}
I need a little help . I want a program whose output is :
Enter a positive integer : 5
1
22
333
4444
55555
I know its gotta be done using for loops but can anyone help?
I have made so far:
#include<iostream.h>
#include<conio.h>
void main(void)
{
int x;
cout<<"Enter a positive integer ?";
cin>>x;
for ( int i=1; i<=x; i++ )
{
cout<<i<<endl;
}
getch();
}
