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 / veeraj.j

#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 ?    11 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does typeof return in c?

1161


What is the use of static variable in c?

1142


What the different types of arrays in c?

1124


Explain the use of function toupper() with and example code?

1171


Is array name a pointer?

1079


What is use of integral promotions in c?

1207


What is the full form of getch?

1355


What type is sizeof?

1086


What is the difference between a free-standing and a hosted environment?

1193


What is the use of the function in c?

1072


Define circular linked list.

1082


Is it valid to address one element beyond the end of an array?

1226


What is %g in c?

1120


How can variables be characterized?

2238


What is the best way to store flag values in a program?

1124