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...

write a program to search for an element in a given array.
If the array was found then display its position otherwise
display appropriate message in c language

Answer Posted / laxmi

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5]={1,2,3,4,5};
int i;
clrscr();
printf("
enter the value");
scanf("%d",&i);
for(i=0;i<5;i++)
if(i<5)
{
printf("
the value is present=%d");
}
else
{
printf("
the value is absent=%d");
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is preprocessor with example?

1008


What is the difference between far and near ?

1161


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2084


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3205


What is the benefit of using #define to declare a constant?

1057


Where are the auto variables stored?

1101


What is a lookup table in c?

1056


How can I swap two values without using a temporary?

1067


Differentiate between new and malloc(), delete and free() ?

1146


What are the functions to open and close file in c language?

1143


What are the features of the c language?

1045


What are the basic data types associated with c?

1231


Explain what are the different file extensions involved when programming in c?

1064


What are loops c?

1009


Explain bit masking in c?

1091