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
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Explain what is the benefit of using const for declaring constants?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What is the sizeof () a pointer?
Describe explain how arrays can be passed to a user defined function
find the sum of two matrices and WAP for it.
How can I read in an object file and jump to locations in it?
Are the variables argc and argv are local to main?
What is c variable?
Difference between MAC vs. IP Addressing
What are all different types of pointers in c?
Explain how can I write functions that take a variable number of arguments?
What is hashing in c?
What is the sizeof () operator?
program for reversing a selected line word by word when multiple lines are given without using strrev