Answer Posted / pavan_mustyala
/**************************
Locates Search Element in the array and returns it's
position. If not found returns -1(Invalid)
**************************/
int locateElement(int *arr, int searchElement, int
arraySize)
{
int i = -1;// Invalid Id
for(i = 0; i < arraySize; i++)
{
if(arr[i] == searchElement)
{
return i; // Element found at this index in the array
}
}
return -1; // Search Element not found in the array
}
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L
Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
develop a program to calculate and print body mass index for 200 employees
How to Split Strings with Regex in Managed C++ Applications?
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
how to diplay a external image of output on winxp by using c & c++,
Write a simple encryption program using string function which apply the substitution method.
Code for Easily Using Hash Table?
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used