+ 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

16th Mar 2017, 8:46 PM
Legendary
4 Réponses
+ 3
replace last for loop by:- for(j=i;j>=1;j--)
16th Mar 2017, 8:50 PM
Meharban Singh
Meharban Singh - avatar
+ 2
Anytime :-)
16th Mar 2017, 8:55 PM
Meharban Singh
Meharban Singh - avatar
27th Jan 2018, 2:14 AM
Majestic Ayush
Majestic Ayush - avatar
+ 1
it's work 👍 thanx😊
16th Mar 2017, 8:55 PM
Legendary