+ 1

how to print different pattern

16th Jun 2016, 4:38 PM
sneha
sneha - avatar
7 Answers
+ 1
patterns like a triangle with the character "*" and like to print the alphabet " I " using the symbol "#"
16th Jun 2016, 5:28 PM
sneha
sneha - avatar
+ 1
#include<iostream> using namespace std; int main() { cout<<"triangle"<<endl; for(int i=0;i<3;i++) { cout<<endl; for(int j=0;j<i+1;j++) cout<<"*"<<" "; } return 0; }
17th Jun 2016, 4:53 AM
DJ Shiva & DJ Baba Shiv-Shekhar
DJ Shiva & DJ Baba Shiv-Shekhar - avatar
+ 1
by diff logic in loop u can make diff patterns try it yourself
17th Jun 2016, 4:54 AM
DJ Shiva & DJ Baba Shiv-Shekhar
DJ Shiva & DJ Baba Shiv-Shekhar - avatar
+ 1
I hope u are talking about Diamondo/Alphabet/number pattern. for any pattern program u must understand loops,specifically for loop. just search on google simple pattern program understand its working deeply& step by step(dont just copy it or try to mug it).then go to programiz.com website . and try to solve more complex program on pattern on your own. this is imp u must push your limit.give some time it will take 3days for me to understand it. and soon it will be peace of cake 4 you.
17th Jun 2016, 5:12 AM
jean parker
jean parker - avatar
0
of what?
16th Jun 2016, 5:19 PM
VPA
VPA - avatar
0
#include <upstream> #include <string> using namespace std; //class? English? int main () { string a = "whatever@symbols&you§like/here."; char b = '£'; cout << string a << endl; cout << char b << endl; return 0; } /* Untested, and half asleep whilst typing this, but should work? Not certain what you mean, but either of these should print characters to screen? You can add multiple strings too... or multiple direct couts in ""s. Hope is what you meant and helps (and my answer is correct lol) */
16th Jun 2016, 7:41 PM
Sparkone
Sparkone - avatar
21st Jul 2020, 1:01 AM
shubham kumar
shubham kumar - avatar