#include<stdio.h>
#include<conio.h>
void main()
{
int arr[100],size,i,num,found=0;
clrscr();
printf("Enter the size of the array: ");
scanf("%d",&size);
printf("Enter any %d integer values: ",size);
for(i = 0; i < size; i++)
scanf("%d",&arr[i]);
printf("Enter the element to be Search: ");
scanf("%d",&num);
for(i = 0; i < size; i++)
{
if(num == arr[i])
{
found=1;
break;
}
}
if(found==1)
printf("\n %d found",num);
else
printf("\n %d not found",num);
getch();
}
#include<conio.h>
void main()
{
int arr[100],size,i,num,found=0;
clrscr();
printf("Enter the size of the array: ");
scanf("%d",&size);
printf("Enter any %d integer values: ",size);
for(i = 0; i < size; i++)
scanf("%d",&arr[i]);
printf("Enter the element to be Search: ");
scanf("%d",&num);
for(i = 0; i < size; i++)
{
if(num == arr[i])
{
found=1;
break;
}
}
if(found==1)
printf("\n %d found",num);
else
printf("\n %d not found",num);
getch();
}

.jpeg)
0 Comments