|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
Write code to solve the following problem. Define a function that takes a String as a parameter and returns an integer value. The function need to loop through each character in the input string to find a value of “x”. If a value of “x” is found in the string then return the position within the string where “x” is found else return -1. |
|
||||
|
What I'm curious about is how the OP managed to have a Signature Link with only 1 post, when the stated rules require 10 for such!
__________________
The Penn State Ticket Man http://www.pennstateticketman.com http://www.happyvalleytickets.com http://www.hounddogtours.com |
|
|||
|
I can write you the whole thing but it is better not to do so to make you think of it, I will just give you some hints.
you need to define the function to take an array of char type ex: int func(char str[]) then loop through str array using for loop or while loop or whatever and in the loop check on str[i] and 'x' if found just return i where i is the loop counter then after the loop (which will be reached only if 'x' is not found just type return -1 hope I could help Quote:
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How is a new web programming language written ? | jeena1 | Web Programming Discussion Forum | 10 | 03-19-2009 08:28 PM |
| Favourite Programming Language? | nojip | Web Programming Discussion Forum | 3 | 07-20-2008 01:28 AM |
| what programming language should I use for context ad application? | EditFast | Web Programming Discussion Forum | 1 | 06-14-2007 09:06 AM |
| Programming Language Inventor or Serial Killer | Mac 5 | The Castle Breakroom (General: Any Topic) | 1 | 03-25-2004 05:28 PM |
| I have a question about the English language | janeth | The Castle Breakroom (General: Any Topic) | 7 | 11-03-2003 01:52 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |