triangle shape


Program to generate following output


#include <iostream.h>

#include <conio.h> 

int main()

{

for (int i=0; i<=5; i++)

{

cout<<endl;

for(int j=1;j<=i;j++)

cout<<"  "<<j;

}

getch();

return 0;

}

No comments :

Post a Comment