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
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is self-referential structure in c programming?
What is pointer and structure in c?
What is the purpose of the preprocessor directive error?
What is double pointer in c?
Explain the difference between malloc() and calloc() in c?
What are external variables in c?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What should malloc(0) do?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
What is structure pointer in c?
Explain the properties of union.
Write the syntax and purpose of a switch statement in C.