Answer to Question #4415 in C++ for Yuri

Question #4415
Program that display an inverted triangle using nested for loop.


Please use basic functions only.. thanks
1
Expert's answer
2011-10-18T08:26:58-0400
#include "stdafx.h"
#include "iostream"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int size;
int z;
cout<<"Input size of triangle plz:"<<endl;
cin>>size;
z = size;
while(size)
{
& for (int i=0; i<size; i++)
& {
& & cout<<"* ";
& }
& cout<<endl;
& size--;
& for (int p = size; p<z; p++) // from Ukraine with love :)
& {
& cout<<" ";
& }
}
system("pause");

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS