make this design using for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

make this design using for loop

7777777 7 7 7 7 7 7

5th Oct 2016, 4:49 PM
ARUN BABU
ARUN BABU - avatar
3 Answers
+ 5
#include <iostream> #include <iomanip> using namespace std; int main() { for (int i = 0; i < 7; i++){ for (int j = 0; j < 7; j++){ if (i == 0) cout << "7"; if(j==6 && i !=0) cout<<setw(7-i)<<"7"; } cout<<endl; } return 0; }
5th Oct 2016, 6:59 PM
Emir
0
cool
6th Oct 2016, 3:39 PM
jacky
jacky - avatar
0
can you explain your code
15th Jan 2017, 2:45 AM
afnan
afnan - avatar