Write a program using one dimensional array that searches a
number and display the number of times it occurs on the list
of 12 input values.
Sample input/output dialogue:
Enter 12 values:
13 15 20 13 30 35 40 16 18 20 18 20
Enter number to search: 20
Occurences: 3
Answers were Sorted based on User's Feedback
Answer / naveen kumar
change the sizeof array a[12] instead of a[4]
| Is This Answer Correct ? | 7 Yes | 15 No |
Answer / sreejesh1987
#include<stdio.h>
#include<conio.h>
void main()
{
int i,flag=0;
float s,a[4];
clrscr();
printf("Enter Twelve numbers:");
for(i=0;i<12;i++)
scanf("%f",&a[i]);
printf("Enter a number to search:");
scanf("%f",&s);
for(i=0;i<12;i++)
if(a[i]==s)
flag++;
printf("\nOccurances:%d",flag);
getch();
}
| Is This Answer Correct ? | 16 Yes | 32 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,
readers and writers problem
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
3 Answers TCS, Vimukti Technologies, Wipro,
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
write a program that reads a series of strings and prints only those strings begging with letter "b"
Code for Easily Using Hash Table?
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 proram using exceptional handling create a error & display the message "THERE IS AN ERROR?... PLEASE RECTIFY"?
write a function – oriented program that calculates the sum of the squares from 1 to n. thus, if the input is 3, the output is 14
how to find out the maximum number out of the three inputs.
6 Answers ABC, Apple, C3I, HP, TCS,
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
How can I Draw an ellipse in 3d space and color it by using graph3d?