Shape | Sololearn: Learn to code for FREE!

+1

Shape

#include <iostream> using namespace std; int main() { int i,j,k; for(i=1;i<=4;i++) { for(k=3;k>=i;k--) cout<<"-"; for(j=1;j<=i;j++) cout<<j; cout<<endl; } return 0; } hey how can I make ---1 --21 -321 4321 inestead of ---1 --12 -123 1234

3/16/2017 8:46:12 PM

Legendary

4 Answers

New Answer

+3

replace last for loop by:- for(j=i;j>=1;j--)

+2

Anytime :-)

+2

https://code.sololearn.com/WElv9Jltw872/?ref=app

+1

it's work 👍 thanx😊