#include<stdio.h>
#include<conio.h>
void main()
{
int i,n=10,k[10],x;
clrscr();
for(i=1;i<=n;i++)
{
printf("\n\tEnter value:-");
scanf("%d",&k[i]);
}
printf("\n\n\tEnter No you want to search:-");
scanf("%d",&x);
i=1;
while(k[i]!=x)
{
i=i+1;
if(i==n+1)
{
printf("\n\n\t\tsuccessful search");
getch();
return;
}
}
printf("\n\n\t\tunsuccessful search");
getch();
}
#include<conio.h>
void main()
{
int i,n=10,k[10],x;
clrscr();
for(i=1;i<=n;i++)
{
printf("\n\tEnter value:-");
scanf("%d",&k[i]);
}
printf("\n\n\tEnter No you want to search:-");
scanf("%d",&x);
i=1;
while(k[i]!=x)
{
i=i+1;
if(i==n+1)
{
printf("\n\n\t\tsuccessful search");
getch();
return;
}
}
printf("\n\n\t\tunsuccessful search");
getch();
}
No comments:
Post a Comment