Write a program to print the following pattern
m
ma
man
mano
manos
manosh
manoshe
manosh
manos
mano
man
ma
m
#include<stdio.h>
main()
{
int i,j;
char string[]="manoshe\n";
printf("\n\n");
printf("manoshe\n");
printf("____________\n");
for(i=0;i<6;i++)
{
j=i+1;
printf("| %-7.*s|\n",j,string);
}
for(i=6;i>=0;i--)
{
j=i+1;
printf("| %-7.*s|\n",j,string);
}
printf("____________\n");
}
m
ma
man
mano
manos
manosh
manoshe
manosh
manos
mano
man
ma
m
#include<stdio.h>
main()
{
int i,j;
char string[]="manoshe\n";
printf("\n\n");
printf("manoshe\n");
printf("____________\n");
for(i=0;i<6;i++)
{
j=i+1;
printf("| %-7.*s|\n",j,string);
}
for(i=6;i>=0;i--)
{
j=i+1;
printf("| %-7.*s|\n",j,string);
}
printf("____________\n");
}
ANSI C by
ReplyDeleteBALAGURUSAMY