/* Use printf() to print the first 11 characters of source_str. */printf(?First 11 characters: ?%11.11s?n?, source_str);
by using extract method we can extract a part from the stringstrextract(3,7)
this is an uncomplied version....int i=0,j=0,p;char *s;printf("Enter the String");scanf("%s",&s);printf(" Enter the start and end of the string: ");scanf("%d %d",&i,&j);for(p=i;p<=j;p++){printf("%c",*(s+p);}getch()}
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
Copyright ©2003-2009 CoolInterview.com, All Rights Reserved. Privacy Policy | Terms and Conditions Page URL: http://www.coolinterview.com/interview/1012/default.asp?cachecommand=bypass