#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
int gd=DETECT,gm,x,a,b;
initgraph (&gd,&gm,"c:\\tc\\bgi ");
while(!kbhit()) //display a triangle till a key is pressed
{
setcolor(WHITE);
line(300,200,400,300);
line(300,200,200,300);
line(200,300,400,300);
}
getch();
}
123456(input)
ReplyDelete1
12
123
1234
12345
123456
witkout array how possible???
#include
ReplyDeleteusing namespace std;
int main()
{
int i,j,rows;
cout<<"Enter the number of rows: ";
cin>>rows;
for(i=rows;i>=1;--i)
{
for(j=1;j<=i;++j)
{
cout<<j<<" ";
}
cout<<"\n";
}
return 0;
}