Thursday, 29 September 2016

Program to print following pattern

Program to print  following pattern.

A
A   B
A   B   C
A   B   C   D
A   B   C   D   E

//program to print the above pattern.
#include<stdio.h>
#include<conio.h>
void main ( )
{
char ch;
int i,j;
clrscr( );
for(i=1;i<=5;i++)
{
ch='A';
for(j=1;j<=i;j++)
{
putchar (ch);
ch++;
}
printf("/n");
}
getch( );
}

0 comments: