Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



Write a program using one dimensional array that searches a number and display the number of times ..

Answer / naveen kumar

change the sizeof array a[12] instead of a[4]

Is This Answer Correct ?    7 Yes 15 No

Write a program using one dimensional array that searches a number and display the number of times ..

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

Post New Answer

More C++ Code Interview Questions

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

1 Answers   Cognizant,


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.

0 Answers   HCL, SRCASW,


write a program that reads a series of strings and prints only those strings begging with letter "b"

0 Answers  


Code for Easily Using Hash Table?

0 Answers  


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"?

1 Answers  


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

3 Answers  


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

0 Answers  


How can I Draw an ellipse in 3d space and color it by using graph3d?

0 Answers  


Categories