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
How are Structure passing and returning implemented by the complier?
pierrot's divisor program using c or c++ code
What header files do I need in order to define the standard library functions I use?
Why do we use c for the speed of light?
Hai what is the different types of versions and their differences
Explain what is a pragma?
What is merge sort in c?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Which is more efficient, a switch statement or an if else chain?
How would you obtain the current time and difference between two times?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Which type of language is c?
hi, which software companys will take,if d candidate's % is jst 55%?
Explain what is the difference between #include and #include 'file' ?
how to execute a program using if else condition and the output should enter number and the number is odd only...