Computer Science, asked by sanzidawasi, 1 month ago

#include <stdio.h>
#include <conio.h>

#define N 5
void main()
{
int search;
int array[N];
inti, flag=0;
for(i=0;i<N; i++)
{
printf("Enter the element at location %d \n", i);
scanf("%d",&array[i]);
}

for(i=0;i<N; i++)
{
printf("Element at location %d is %d \n", i, array[i]);
}

printf("Enter the number you would wish to search\n");
scanf("%d", &search);

for(i=0;i<N; i++)
{
if(array[i]==search)
{
printf("Number found at location %d\n", i);
flag++;
}
}
if(flag==0)
printf("Number not found");
else
printf("Occurrences = %d ", flag);
getch();
}
code name?​

Answers

Answered by himanshu2006vps
0

Answer:

Code name is Linear search or to to search a number in a array

Similar questions