Answer Posted / meera
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50],i,j,n,key,count=0;
clrscr();
printf("Enter the no.of elements:");
scanf("%d",&n);
printf("Enter the numbers:");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("enter the number to be searched:");
scanf("%d",&key);
for(i=0;i<n;i++)
{
if a[i]==key
(
count++;
printf("\nThe number %d is present",key);
}
}
printf("number of occurance is %d",count);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What is hungarian notation? Is it worthwhile?
What is a union?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What is static volatile in c?
which type of aspect you want from the student.
What are local static variables?
Combinations of fibanocci prime series
What are the different types of data structures in c?
I heard that you have to include stdio.h before calling printf. Why?
How do I copy files?
What is the value of c?
Why n++ execute faster than n+1 ?
What is pass by reference in c?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.