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 are extern variables in c?

995


Explain 'far' and 'near' pointers in c.

1144


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

2044


What are header files? What are their uses?

1217


How can I call fortran?

1047


How do you use a pointer to a function?

1087


What is ## preprocessor operator in c?

1089


provide an example of the Group by clause, when would you use this clause

2199


Why is extern used in c?

1093


Is register a keyword in c?

1045


What is 2c dna?

1081


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2325


What is use of #include in c?

1169


What is the value of h?

1043


Explain what is a program flowchart and explain how does it help in writing a program?

1099