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 %c do in c?
Explain the red-black trees?
What is #line in c?
What extern c means?
Write a C program to count the number of email on text
Write program to remove duplicate in an array?
Write a program to reverse a string.
How do you define a function?
What are Macros? What are its advantages and disadvantages?
How pointer is different from array?
Write a program to check whether a number is prime or not using c?
Why c is called procedure oriented language?
What are the 5 data types?
Explain what are the standard predefined macros?
What language is windows 1.0 written?