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 to find the frequency of a number

Answer Posted / vikky_manit

#include<stdio.h>
void main()
{
int a[10],n,key,count=0;
printf("Enter the number of elements\n");
scanf("%d",&n);
printf("Enter %d elements\n",n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Enter the element whose frequency is to be
determined\n");
scanf("%d",key);
for(i=0;i<n;i++)
if(key==a[i])
count++;
printf("Frequency=%d",count);
}

Is This Answer Correct ?    39 Yes 36 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of #include in c?

1078


Define Array of pointers.

1101


Explain what is a stream?

1083


Why is it usually a bad idea to use gets()? Suggest a workaround.

1777


There seem to be a few missing operators ..

1046


Can include files be nested?

1100


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2572


Why can't I perform arithmetic on a void* pointer?

1089


How would you obtain the current time and difference between two times?

1284


What is meant by preprocessor in c?

1006


List some of the static data structures in C?

1196


pierrot's divisor program using c or c++ code

2235


Why shouldn’t I start variable names with underscores?

1056


program to convert a integer to string in c language'

2451


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

1137