Write a program using one dimensional array that accept five
values from the keyboard. Then it should also accept a
number to search. This number is to be searched if it among
the five input values. If it is found, display the message
“Search number is found!” otherwise, display “Search is lost”.
Example:
Enter 5 numbers: 10 15 20 7 8
Enter number to search: 7
Search number is found!
Answers were Sorted based on User's Feedback
Answer / sreejesh1987
#include<stdio.h>
#include<conio.h>
void main()
{
int i,flag=0;
float s,a[4];
clrscr();
printf("Enter Five numbers:");
for(i=0;i<5;i++)
scanf("%f",&a[i]);
printf("Enter a number to search:");
scanf("%f",&s);
for(i=0;i<5;i++)
if(a[i]==s)
flag=1;
if(flag==1)
printf("\nSearch number found");
else
printf("Search number not found");
getch();
}
| Is This Answer Correct ? | 39 Yes | 25 No |
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
0 Answers Jomo Kenyatta University,
what is virtual constroctor ? give an exam for it?-(parimal dhimmar)
Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.
readers and writers problem
hello friends, given an expression we have to remove the unwanted brackets in that expression. Eg : (a+b) ---> a+b (a+b)*(c)-----> (a+b)*c. Please mail me if you know the logic. My mail id is : saravana6m@gmail.com. Thank you in advance :-)
1 Answers GrapeCity, Microsoft,
write a program that reads a series of strings and prints only those strings begging with letter "b"
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.
write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000
write a program that can locate elements in array.
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
Deriving time complexity of Binary tree and AVL tree, step by step.
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