i have my very difficult problem :
here it is :
the output must be :
Enter number 5:
\\output......
1
12
123
1234
12345
here is my code :
#include <iostream>
#include <conio>
main()
{
int a,x,y;
cout<<"Enter number: ";
cin>>a;
if(a>3)
{
for(x=a;x>=1;x--)
{
for(y=1;y<=x;y++)
{
cout<<y;
}
cout<<"\n";
}
}
getch();
}
the problem is that
when i run my source code in c++.
the output is :
12345
1234
123
12
1
whats wrong with my code? ...... can some figure it out....
thanks.