Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


read an array and search an element



read an array and search an element..

Answer / 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

More C Interview Questions

When we use void main and int main?

0 Answers  


Explain function pointer with exapmles.

2 Answers  


Why cant I open a file by its explicit path?

0 Answers  


How do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers  


What are the salient features of c languages?

0 Answers  


how to set Nth bit of variable by using MACRO

3 Answers   HCL,


WAP to find that given no is small or capital

3 Answers  


What do you mean by dynamic memory allocation in c? What functions are used?

0 Answers  


why integer range between -327680to+32767

2 Answers  


What are 'near' and 'far' pointers?

0 Answers  


Multiply an Integer Number by 2 Without Using Multiplication Operator

0 Answers  


Categories