+ 1
Anybody please help me understanding this code in C:
#include<stdio.h> void main() {     int i,j;     printf(â\n Alphabetical Pattern\n\nâ);     for(i=âAâ;i<=âZâ;i++)     {         for(j=âAâ;j<=i;j++)         {             printf(â %c â,j);         }         printf(â\nâ);     } }
1 Answer
+ 1
the following code will produce:-
Alphabetical Pattern
A
AB
ABC
ABCD
.
like this till A-Z
the main code of this program lies in 2 for loops
1. will go from A to Z
2. will go from A to 1st loop's var.
followed by a new line "\n"
line printf(" %c ",j);
will print the value of "j" which is a character type.
thus %c is a format specifier to print a character.
in C printf() is use to print something on screen, like cout in C++.
hope it would help!