C

Alphabet Triangle Pattern

41
0
Home C Alphabet Triangle Pattern

The program must accept an alphabet CH as the input. The program must print the desired pattern as shown in the Example Input/Output section.


Input Format:
The first line contains the alphabet CH.


Output Format:
The lines containing the desired pattern as shown in the Example Input/Output
section.


Example Input/Output 1:

Input:
F

Output:
A
BB
CCC
DDDD
EEEEE
FFFFFF

Example Input/Output 2:

Input
g

Output
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG

#include<stdio.h>
#include<stdlib.h>
int main()
{
	char a;
	scanf("%c",&a); 

//converting the user input to uppercase
	a=toupper(a);

	for (char i='A';i<=a;i++)
	{
		for (char j='A';j<=i;j++)
			printf("%c",1);
		printf("\n")
	}
}
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *