How to generate a pattern in c??which looks like one by one | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to generate a pattern in c??which looks like one by one

help

11th Sep 2021, 4:02 AM
Pooja Shetty
5 Answers
+ 4
One by one? you mean like two number 1 standing side by side?
11th Sep 2021, 4:30 AM
Ipang
+ 4
Give one example your question is not clear. For pattern programs you should be strong in loops and conditions .
11th Sep 2021, 4:47 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
11th Sep 2021, 7:13 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
+ 1
AKSHAY🇮🇳 haha! You could have just output 11 😂😂 ...but still it’s not a pattern (that was probably the only part of the question that was clear) Here’s a simple 1 by 1 pattern: int main() { for(int i = 0; i <= 50; i++) { if (i % 2) printf("~"); else printf("1"); } return 0; }
11th Sep 2021, 7:15 PM
DavX
DavX - avatar
0
DavX Yeah I could, but in India we used to say fractional sign as "by" like if it is 3 — 4 We will say it "3 by 4", and as one by one is not possible, so 1 by 2🤷🏻‍♂️
12th Sep 2021, 2:52 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar