CoolInterview.com - World's Largest Collection of Interview Questions
 Interview Questions  
 Our Services  

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!


    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS LANGUAGES C DETAILS
    Question :
    How do you print only part of a string?
    Category C Interview Questions
    Rating (2.8) By 9 users
    Added on 10/22/2004
    Views 3975
    Rate it!
    Answers:

    /* 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 string
    strextract(3,7)



     Posted by: vani    

    Contact vani  Contact vani

    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()
    }



     Posted by: rohan sekhri    

    Contact rohan sekhri  Contact rohan sekhri


    If you have the better answer, then send it to us. We will display your answer after the approval.
    Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What is indirection?
    View Answer
    How many levels of pointers can you have?
    View Answer
    What is a null pointer?
    View Answer
    What is a void pointer?
    View Answer
    Is NULL always defined as 0?
    View Answer
    What does it mean when a pointer is used in an if statement?
    View Answer
    Can you add pointers together? Why would you?
    View Answer
    How do you use a pointer to a function?
    View Answer
    When would you use a pointer to a function?
    View Answer
    Why should we assign NULL to the elements (pointer) after freeing them?
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL C Interview Questions

    User Options
    Sponsored Links


    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


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | Joke of the Day

    0.39