//Code:
#include
#include
#include
void main()
{
char ch[50];
int i=0,j,n,a,b;
clrscr();
printf("\n Enter a string : ");
gets(ch);
n=strlen(ch);
printf("\n Enter lower and upper limit between %d to %d : ",i,n-1);
scanf("%d%d",&a,&b);
printf("\n The extracted string is : ");
for(i=a;i<=b;i++)
printf("%c",ch[i]);
getch();
}
/*Output:
Enter a string : my name is .............
Enter lower and upper limit between 0 to 26 : .......
The extracted string is : ...........
No comments:
Post a Comment