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

#include<stdio.h>
#include<conio.h>
void main()
int a[5],i;
int e,t=0,p=0;
clrscr();
printf("enter the array of elements/n");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
clrscr();
printf("enter the element to search/n");
scanf("%d",&e);
for(i=0;i<5;i++)
{
if(a[i]==e)
{
t=1;
p=i;
}
}
if(t==1)
printf("element found--%d/n position--%d",e,p);
else
printf("element not found/n");
getch();
}

Is This Answer Correct ?    21 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program for Overriding.

1127


What is strcpy() function?

1094


What is the process to create increment and decrement stamen in c?

1008


difference between Low, Middle, High Level languages in c ?

2034


Define and explain about ! Operator?

966


The statement, int(*x[]) () what does in indicate?

1096


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2140


Are comments included during the compilation stage and placed in the EXE file as well?

1037


Which is better between malloc and calloc?

1133


How to get string length of given string in c?

1022


Explain that why C is procedural?

1095


What are structure members?

1042


What do you mean by a local block?

1040


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

1121


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15942