Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  triangle
Language: C/C++
Code:
#include<iostream>
using namespace std;
int main()
{int i,j,width,height;
while(1)
{cout<<" enter width and height : "<<endl;
cin>>width>>height;
for(i=1;i<width;i++)
{for(j=1;j<height;j++)
cout<<" * ";
height++;
cout<<endl;}
for(i=1;i<width;i++)
{for(j=1;j<height;j++)
cout<<" * ";
height--;
cout<<endl;}}
cin.get();
return 0;}
Comments: