Pattern 16
write a prog. to print following pattern
#include<conio.h>
#include<stdio.h>
void main()
{
int n=0,m=65,i,j;
clrscr();
printf("Enter N:");
scanf("%d",&n);
printf("\n\n");
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",m);
}
printf("\n");
m++;
if(m>90)
{
m=64;
}
}
getch();
}
O/P:
write a prog. to print following pattern
A
BB
CCC
DDDD
EEEEE#include<conio.h>
#include<stdio.h>
void main()
{
int n=0,m=65,i,j;
clrscr();
printf("Enter N:");
scanf("%d",&n);
printf("\n\n");
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",m);
}
printf("\n");
m++;
if(m>90)
{
m=64;
}
}
getch();
}
O/P:
No comments:
Post a Comment