#include<stdio.h>
#include<conio.h>
int main()
{
int i,n,anik,k= -1;
printf("Enter any number : ");
scanf("%d",&n);
int rob[n];
printf("\nEnter %d number : ",n);
for(i=0;i<n;i++)
{
scanf("%d",&rob[i]);
}
printf("\nEnter any number for searching : ");
scanf("%d",&anik);
for(i=0;i<n;i++)
{
if(anik == rob[i])
{
k = i;
break;
}
}
if(k == -1)
{
printf("\n%d is not found\n",anik);
}
else
{
printf("\n%d is found at %d position",anik,i+1);
}
getch();
}
#include<conio.h>
int main()
{
int i,n,anik,k= -1;
printf("Enter any number : ");
scanf("%d",&n);
int rob[n];
printf("\nEnter %d number : ",n);
for(i=0;i<n;i++)
{
scanf("%d",&rob[i]);
}
printf("\nEnter any number for searching : ");
scanf("%d",&anik);
for(i=0;i<n;i++)
{
if(anik == rob[i])
{
k = i;
break;
}
}
if(k == -1)
{
printf("\n%d is not found\n",anik);
}
else
{
printf("\n%d is found at %d position",anik,i+1);
}
getch();
}
Comments
Post a Comment