For this I am going to print string called america in pattern. For more information have a look for the source code and output of the program.
The output displayed is:
The source code for the output given below is:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<string.h> | |
int main() | |
{ | |
char name[8]="AMERICA"; | |
int l,a,b; | |
l=strlen(name); | |
for(a=0;a<=l;a++) | |
{ | |
for(b=0;b<(l-a);b++) | |
{ | |
printf(" "); | |
} | |
for(b=(l-a);b<=l;b++) | |
{ | |
printf("%c",name[b]); | |
} | |
printf("\n "); | |
} | |
getch(); | |
} |
0 comments :
Post a Comment