MY SOLVE Q22

You are asked to write a C++ program that reads a positive integer, greater than zero, from the user and then outputs a triangle of numbers as appear in the example below. The size of the triangle depends on the integer entered by the user.
Example, if the user enters the number 5 as input, the following triangle appears on the screen:
1
2 2
1 2 3
4 4 4 4
1 2 3 4 5

#include <vcl.h>
#include "MT262io.h"
#include <iostream.h>
#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
int main(int argc, char* argv[])
{
cout<<"Please Enter an integer number : ";
int x,y=1,N;
cin>>N;
while(y<=N)
{
x=1;
while(x<=y)
{
if (y%2==1)
{
cout<<(x(;
cout<<" ";
}else{
cout<<(y(;
cout<<" " ;
}
x++;
}
cout<<"\n";
y++;
}
Getchar();

return 0;
}
ANY ONE CHEACK MY SOLVE AND TELL ME
THANKES ALL
I can' t compile without #include "MT262io.h".

It would help to read if you use format "source code" option
that some liblyry in my cours
Topic archived. No new replies allowed.