Wednesday, 8 September 2021

Write a program to print the full Pyramid of alphabets...

#include<stdio.h>
#include<conio.h>

void main()
{
	int i,j,rows,k,ch='A';
	
	printf("Enter a number to define the rows :");
	scanf("%d",&rows);
	
	for(i=1;i<=rows;i++)
	{
		for(j=1;j<=rows-i;j++)
		{
			printf(" ");
			
		}
		for(k=1;k<=(2*i-1);k++)
		{
			printf("%c",ch);
		}
		ch++;
		printf("\n");
	}
	getch();
}
Youtube video.

No comments:

Post a Comment

Program to check whether the reverse string is a palindrome

  # include < stdio.h > # include < string.h > int main ( ) { //declare variables char str1 [ 30 ] ; int i , len...