Write a C program for ABC Triangle

 EXPECTED OUTPUT

CODE:


#include<stdio.h>
int main(){
int i,j,n;
char ch='A';

printf("Enter range: ");
scanf("%d",&n);

printf("\n");

for (i=1;i<=n;i++)
{
for (j=1;j<=i;j++) // to print alphabet as per row
{
printf("%c ",ch);
}
ch++; // Increment in character A to B then to C and so on
printf("\n");
}

}



NEED WORK PRODUCE WORK

My name is Abdul Rehman I am from Pakistan. I am doing BS in Computer and information sciences. Currently, I am creating these blogs to help students of computer sciences all over the world..

3 Comments

Post a Comment
Previous Post Next Post