#include
#include
main()
{
char string[100];
int c, k, length;
clrscr();
printf("Enter a string\n");
gets(string);
length = strlen(string);
for ( c = 0 ; c < length ; c++ )
{
for( k = 0 ; k <= c ; k++ )
{
printf("%c", string[k]);
}
printf("\n");
}
getch();
return 0;
}
-----------------------------
output:-
Enter a string
amit singh
a
am
ami
amit
amit
amit s
amit si
amit sin
amit sing
amit singh
No comments:
Post a Comment