#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define MAX 15
void main()
{
int arr[MAX];
int i,num;
int a;
printf("\nEnter no. of elements:- ");
scanf("%d",&num);
for(i=0;i<num;i++)
{
printf("\nEnter value:- ");
scanf("%d",&arr[i]);
}
printf("\nEnter the value you want to search:- ");
scanf("%d",&a);
i=0;
while(arr[i]!=a)
{
i++;
}
if(arr[i]==a)
{
printf("\nElement fountd !");
}
else
{
printf("\nElement Doesn't found !");
}
}
#include<conio.h>
#include<stdlib.h>
#define MAX 15
void main()
{
int arr[MAX];
int i,num;
int a;
printf("\nEnter no. of elements:- ");
scanf("%d",&num);
for(i=0;i<num;i++)
{
printf("\nEnter value:- ");
scanf("%d",&arr[i]);
}
printf("\nEnter the value you want to search:- ");
scanf("%d",&a);
i=0;
while(arr[i]!=a)
{
i++;
}
if(arr[i]==a)
{
printf("\nElement fountd !");
}
else
{
printf("\nElement Doesn't found !");
}
}
No comments:
Post a Comment