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

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


Please Help Members By Posting Answers For Below Questions

"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

1155


What is hungarian notation? Is it worthwhile?

1271


What is a union?

1085


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1368


What is static volatile in c?

1074


which type of aspect you want from the student.

2205


What are local static variables?

1204


Combinations of fibanocci prime series

1666


What are the different types of data structures in c?

1214


I heard that you have to include stdio.h before calling printf. Why?

1113


How do I copy files?

1104


What is the value of c?

1130


Why n++ execute faster than n+1 ?

3141


What is pass by reference in c?

1235


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.

1734