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 is a wrapper function in c?
What is static function in c?
What is gets() function?
Does c have an equivalent to pascals with statement?
What is hash table in c?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What is the use of #include in c?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What is the difference between %d and %i?
why return type of main is not necessary in linux
What are enums in c?
Why header files are used?
what is the role you expect in software industry?
hi, which software companys will take,if d candidate's % is jst 55%?
How can I run c program?