Nice Programe to print out numbers

I hope you find it nice.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<iostream.h>
void main()
{
int x;
cout<<"This program is Giving you A nice show for your number Exampel:\nIf you enered number 5, the output will be:\n";
x=5;

for(int i=1;i<=x;i++)
{
for(int j=1; j<=i;j++)
cout<<i<<" ";
cout<<endl;
}
cout<<endl;
while(cin)
{
cout<<"Enter Number: ";

cin>>x;
for(int i=1;i<=x;i++)
{
for(int j=1; j<=i;j++)
cout<<i<<" ";
cout<<endl;
}
cout<<endl;
}
you need to learn how to structure your code more nicely also, you should change

#include<iostream.h>

to...

#include <iostream>

but a good starter. keep to it man ;)
its by borland C++ not Visual C++
Topic archived. No new replies allowed.