0

How to made pattern using for

hello, how can i make this pattern using only for 5 10. 15 4 9 14 3 8 13 2 7 12 1 6 11 thank you

21st Nov 2017, 9:23 AM
Dermawan Adji Saputra
Dermawan Adji Saputra - avatar
1 Respuesta
+ 3
Do you even need the dot between the 10 and the 15? If not, you may use this code : #include<iostream> #include<iomanip> using std::cout, std::endl, std::setw, std::left; int main() { for(int i=0;i<5;i++) { cout<<left<<setw(4)<<5-i; cout<<left<<setw(4)<<10-i; cout<<left<<setw(4)<<15-i<<endl; } }
21st Nov 2017, 10:25 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar