google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to Print Half pyramid of alphabets in C.

Write a Program to Print Half pyramid of alphabets in C.

1

 

Write a Program to Print Half pyramid of alphabets in C.

// Write a Program to Print Half pyramid of alphabets in C.

 

#include <stdio.h>

#include <conio.h>

void main() {

   int i, j;

   char input, alphabet = 'A';

   printf("Enter an uppercase character you want to print in the last row: ");

   scanf("%c", &input);

   for (i = 1; i <= (input - 'A' + 1); ++i) {

      for (j = 1; j <= i; ++j) {

         printf("%c ", alphabet);

      }

      ++alphabet;

      printf("\n");

   }

}

 

 

Output

Enter an uppercase character you want to print in the last row: E 

A

B B

C C C

D D D D

E E E E E

 

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

  1. The Chi Tin Pocket Pocket Iron Flated Stainless Steel
    Stainless steel Pocket Iron Flated Stainless Steel and Stainless Steel Nickel Baysuit. Buy The babyliss pro nano titanium Chi Tin Pocket titanium trimmer Iron Flated snow peak titanium spork Stainless Steel and Stainless Steel $9.99 titanium crystal · ‎Out ford edge titanium of stock

    ReplyDelete

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top