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
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Are global variables static in c?
What are structures and unions? State differencves between them.
What is an operator?
Is c still used?
What are the application of c?
What is structure pointer in c?
What is a floating point in c?
How can I write a function analogous to scanf?
What does printf does?
What is calloc in c?
What are the advantages of using Unions?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
in linking some of os executables are linking name some of them
What are linker error?