Program to find an element in one dimensions array.

#include<stdio.h>
#include<string.h>
void main()
{
     int a[10],n,I;
     print(“Enter element of array”);
     for(i=0;i<=9;i++)
        scanf(“%d”,&a[i]);
     printf(“enter the number which you want to search”);
       scanf(“% “%d” d”,&n);
     for(i=0;i<=9;i++)
     {
          if(a[i]==n)
             break;
     }
     if(i==10)
        print(“element is not in the array”);
      else
         printf(“element present in array”);
      getch();
}

2 thoughts on “Program to find an element in one dimensions array.

Leave a Reply

Your email address will not be published.