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
What does typeof return in c?
What is the use of static variable in c?
What the different types of arrays in c?
Explain the use of function toupper() with and example code?
Is array name a pointer?
What is use of integral promotions in c?
What is the full form of getch?
What type is sizeof?
What is the difference between a free-standing and a hosted environment?
What is the use of the function in c?
Define circular linked list.
Is it valid to address one element beyond the end of an array?
What is %g in c?
How can variables be characterized?
What is the best way to store flag values in a program?