0

How to print the following pattern?👇

1 A B 2 3 4 C D E F 5 6 7 8 9

23rd Nov 2017, 12:20 PM
NITANT SHARMA
NITANT SHARMA - avatar
4 Answers
+ 4
an easy way cout << line1 << "\n"; cout << line2 << "\n"; you get the point. Another way you can have mulitple for loops that output acsii for letters and one loop for the numbers.
23rd Nov 2017, 2:56 PM
Manual
Manual - avatar
0
Is not the original pattern
21st Jul 2020, 5:21 AM
Daniel
Daniel - avatar
0
I WROTE THIS CODE IN C# *********************************** using System; class class1 { static void Main() { int m=1; char c='A'; Console.WriteLine("Enter No.of Rows::"); int n = int.Parse(Console.ReadLine()); for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { if(i%2==0) { Console.Write(c+" "); c++; } else { Console.Write(m+" "); m++; } } Console.WriteLine(""); } } }
27th Mar 2021, 10:20 AM
jangili venkateswararao
jangili venkateswararao - avatar
21st Jul 2020, 1:14 AM
shubham kumar
shubham kumar - avatar