Posts

Showing posts with the label Alphabet Pattern

How to print the alphabet pattern

Image
What will be the solution of alphabets pattern for right angle triangle? Fig:-1 This program is executed on DEV C++ you may choose any C or C++ editor to execute the program code will be same. Programming type 1:- #include<stdio.h> #include<conio.h> int main() { int row, col;    //data type deceleration  for(row=0;row<=4;row++)  // for row { for(col=0;col<=row;col++)  //for column { printf(" %c",'A'+row);      //printing the alphabet in pattern } printf("\n"); // for new line } getch(); return 0; } Output:- Fig:-2 Programming type 2:- #include<stdio.h> #include<conio.h> int main() { int row, col;    //data type deceleration  for(row=0;row<=4;row++)  // for row { for(col=0;col<=4;col++)  //for column { if(col<=row)  // condition for printing alphabets in pattern { printf(" %c",'A'+row);     //printing the alp...