Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
   search element
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
 
int main() {
int a[10],i,n,ele;
printf("enter the size of an aray");
scanf("%d",&n);
   printf("enter the array elements");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}

printf("nenter the element to be searched");
scanf("%d",&a[i]);

i=0;
while(i<n && ele!=a[i])
{
i++;
}

if(i<n)
{
printf("nno. found at location %d",a[i+1]);
}
else 

printf("nno.not found");
}

getch();

}


          
          
          
          
          
          
          
          
          
Comments: