#include <stdio.h>
int main()
{
int a[10], i, key, n;
printf("Enter Strength of the Array: ");
scanf("%d", &n);
printf("Enter the element: ");
for (i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
printf("Enter the key: ");
scanf("%d", &key);
for (i = 0; i < n; i++)
{
if (a[i] == key)
{
printf(" %d Element found", key);
return 0;
}
}
printf(" Element not Found");
}
Comments
Post a Comment