Write the test cases for instr function?



Write the test cases for instr function?..

Answer / Arti Sharma

'Test Case 1: haystack = "abcdef", needle = "a" => result should be 0nTest Case 2: haystack = "abcdef", needle = "xyz" => result should be nullnTest Case 3: haystack = "apple", needle = "pple" => result should be 1nTest Case 4: haystack = "", needle = "a" => result should be null'

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Project Planning Interview Questions

can any body help me to know the procedure followed by programmer/developer inorder to develop a project. what are the steps, how he/she get the SRS,technical document??how does he submit his wotk to TL/PM/Business Analyst?? How does these documents review?? how the developer starts coding? how does he deploy his coding in server? in which server he will deploy?? what are the important document a developer should have??? Pls give me a real time scenario of development process, how it is going on in a company???? Thanks in advance

1 Answers  


What training have you undergone in project planning?

1 Answers   Microsoft,


You have 3 jars. Each jar has a label on it: white, black, or white&black. You have 3 sets of marbles: white, black, and white&black. One set is stored in one jar. The labels on the jars are guaranteed to be incorrect (i.e. white will not contain white). Which jar would you choose from to give you the best chances of identifying the which set of marbles in is in which jar?

12 Answers   Intel, Microsoft,


What is DLL HELL?

1 Answers  


What and where are the policy statements for software project planning?

1 Answers   MCN Solutions,


How do you handle change requests ?

4 Answers   Microsoft, Trigent,


Explain dll hell?

1 Answers  


Write a function that counts the number of primes in the range [1-N]. Write the test cases for this function.

2 Answers   Microsoft,


What is the stage when code is delivered to the client and he is testing it ?

5 Answers   Microsoft,


What are the documents that you will refer to create the plan?

1 Answers  


How do you track the size or changes to size of the work products in your project?

1 Answers  


Test the save dialog in Notepad?

1 Answers   Microsoft,


Categories