+ 1
Write a C program to print the following character number pyramid as: 1 A B 2 3 4 C D E F
5 odpowiedzi
+ 8
Here It is 👇👇👇
https://code.sololearn.com/cdNCyW49MeNC/?ref=app
+ 8
Anas El messlati I stopped the loop at ch=G and i=9 if you want you can continue further.
+ 8
Anas El messlati My Pleasure!!!😊😊
+ 2
Just a little different approach in C
#include <stdio.h>
int main()
{
const char* fmt = "%c ";
char ca = 'A', cn = '1';
for(int row = 0; row < 6; ++row)
{
for(int col = 0; col <= row; ++col)
{
if(row & 1)
// even rows
printf(fmt, ca++);
else
// odd rows
printf(fmt, cn++);
}
printf("\n");
}
return 0;
}
+ 1
Thanks Mohammed amir aqeel