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

Explain the advantages of using macro in c language?

966


Explain is it valid to address one element beyond the end of an array?

1164


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1475


What is ctrl c called?

1010


What are the types of macro formats?

1070


What is time complexity c?

957


What are the types of type specifiers?

991


How variables are declared in c?

1008


What is c definition?

1210


Difference between constant pointer and pointer to a constant.

1085


What is volatile, register definition in C

1070


Explain the concept and use of type void.

1073


What is the difference between array and pointer?

979


What are predefined functions in c?

1047


List some applications of c programming language?

916