How can make the following output pyramid reverse?? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How can make the following output pyramid reverse??

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

17th Aug 2020, 12:57 PM
Gaurav Kamble
Gaurav Kamble - avatar
1 Réponse
0
You could eather start with i=r: for (int i=r; i>0; i--) { for(int j=0 ; j<=i; j++) { printf ("*"); } printf ("\n"); } Or you print r-i lines in each row: for (int i=0 ; i<r; i++) { for(int j=0 ; j<=r-i; j++) { printf ("*"); } printf ("\n"); }
17th Aug 2020, 1:00 PM
Alexander Thiem
Alexander Thiem - avatar