#include<stdio.h>
#include<conio.h>
void main()
{
 int i=0,m,n;
 char string[20],character;
 clrscr();
 printf("Enter the text \n  ");
 do
 {
  character=getchar();
  string[i]=character;
  i++;
 } while(character!='\n');
 i=i-1;
 string[i]='\o';
 printf("Enter the position of the character starting from which the ");
 printf("string has to be extracted:");
 scanf("%d",&n);
 printf("Enter the no. of characters to be extracted:");
 scanf("%d", &m);
 printf("\n  ");
 for(i=n-1;i<(m+n-1);i++)
 printf("%c", string[i]);
 getch();
}