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
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What is the purpose of clrscr () printf () and getch ()?
explain what is a newline escape sequence?
What is typeof in c?
What is character constants?
How to establish connection with oracle database software from c language?
What is the use of ?: Operator?
Explain what is page thrashing?
What are the basic data types associated with c?
What are the scope of static variables?
What is p in text message?
Can we increase size of array in c?
Is int a keyword in c?
Is void a keyword in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?