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 are data types in c language?
Can the “if” function be used in comparing strings?
What is a program flowchart and how does it help in writing a program?
Where local variables are stored in c?
using only #include
Explain how do you view the path?
Difference between linking and loading?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What is pointer and structure in c?
What is the difference between printf and scanf in c?
What is data structure in c and its types?
How can I recover the file name given an open stream?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Describe the order of precedence with regards to operators in C.
What are the benefits of c language?