write a function that accepts an integer/char array and an
search item.If the search item is there in the array return
position of array and value else return -1.without using
other array,without sorting,not to use more than one loop?
Answer Posted / nikhil srivastav (mca pesit b
int search(int *arr,int item,int arr_size)
{
int i;
for(i=0;i<arr_size;i++)
{
if(item==*(arr+i))
return i;
}
return -1;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the complete rules for header file searching?
How do I determine whether a character is numeric, alphabetic, and so on?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What is a char in c?
Can we declare variable anywhere in c?
How can you find out how much memory is available?
How do we open a binary file in Read/Write mode in C?
Explain the difference between the local variable and global variable in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is static identifier?
What does emoji p mean?
What is exit() function?
When the macros gets expanded?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
How can I copy just a portion of a string?