help

this programm out put is
*
**
***
this is triangle starting from left..with variable number of star.


i want to make triangle starting from right
what changes are needed in this code?????
plzzzzzz help

the code i give is for left side triangle.and i want triangle which start form right..wht changes need in this code



#include<iostream>
using namespace std;
#include<iomanip>
int main()
{

int i,j,k;
cin>>k;
for(j=1;j<=k;j++)
{

for(i=1;i<=j;i++)
{
cout<<"*";
}
cout<<endl;
}
}

Last edited on
First of all, it is incredibly difficult to understand what you want. You need to post legible English (you know, don't post things like "this is str=ar tri angle", what does that even mean?).

Second, post your code in the code brackets to make it easier for people to read your code.

Is this what you're wanting?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

using namespace std;

int main() {
  int i, j, k;

  cin >> k;

  for (j = 1; j <= k; j++) {
    for (i = 1; i <= j; i++) {
      cout << "*";
    }

    cout << endl;
  }
}
Topic archived. No new replies allowed.