Thursday, July 9, 2009

C programming >>>strings?

program to input a string,if the first word of the string is asked from the user den it shud giv rest of da string...


e.g:


string ----------------------------%26gt; this is a book


1st word of the string ---------%26gt;this


anwser shud be.....------------%26gt;is a book

C programming %26gt;%26gt;%26gt;strings?
void main()


{


char input[100],search[100];


int i=0,len;


printf("enter a string\n");


input=gets();


while (input[i] == search[i])


len++;


for(i=len;input[len]!='\0';i++)


printf("the string is %s",input[i]);


}


i think this will get u the output
Reply:Thinking out how to construct a program to do this is part of how to learn C. By copying and pasting someone else's thoughts, you will learn nothing. Get off Yahoo! Answers, and get down to programming this.


No comments:

Post a Comment