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 is the difference between if else and switchstatement
What is the difference between fread and fwrite function?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What are the string functions? List some string functions available in c.
Write the syntax and purpose of a switch statement in C.
Explain how do you determine a file’s attributes?
Do you know null pointer?
What is the meaning of 2d in c?
What are disadvantages of C language.
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
How can I discover how many arguments a function was actually called with?
Explain is it better to bitshift a value than to multiply by 2?
Can we compile a program without main() function?
What are the disadvantages of c language?
What are local static variables?