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
What does calloc stand for?
What are structural members?
What is c language in simple words?
Tell me is null always defined as 0(zero)?
Why do we use stdio h and conio h?
Write a program for Overriding.
What is calloc() function?
Explain the Difference between the New and Malloc keyword.
What is variable in c example?
What is the difference between int main and void main?
What is floating point constants?
How many types of sorting are there in c?
When is a null pointer used?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Explain how does flowchart help in writing a program?