Tuesday, August 23, 2011

Breaking the string

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char *s;
int len,i,j;
clrscr();
printf("enter a string:");
gets(s);
len=strlen(s);
for(i=0;i<len;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",*(s+j));
}
printf("\n");
}
getch();
}

No comments:

Post a Comment

Feel free to comment......