a program using one dimensional array that searches a number
if it is found on the list of given input numbers given by
the user and locate its exact location in the list..
""EXAMPLE""
enter how many numbers to be inputted: 5
12 14 11 09 30
what number to search: 11
11 IS FOUND IN LOCATION 3
PLZZZ.. ELP ME...
Answer Posted / mukesh yadav
int i,j,a[5];
printf("enter the numbers");
for(i=1;i<=10;i++)
{
scanf("\n%d",a[i]);
}
printf("what number to search:");
scanf("%d",j);
for(i=1;i<=10,i++)
{
if(j==a[i])
{
printf("FOUND IN LOCATION:",i);
exit(0);
}
}
Is This Answer Correct ? | 13 Yes | 10 No |
Post New Answer View All Answers
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.
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
Code for Method of Handling Factorials of Any Size?
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
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.
How can I Draw an ellipse in 3d space and color it by using graph3d?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
How to Split Strings with Regex in Managed C++ Applications?
create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
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
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.