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
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
i don't know about working of nested for loop can any one help me
Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++
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
write a program using virtual function to find the transposing of a square matrix?
develop a program to calculate and print body mass index for 200 employees
How to swap two ASCII numbers?
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!!!)
output for printf("printf");
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
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.
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.