int main()
{
int i,item,list[5];
printf("Enter numbers;\n");
for(i=0;i<5;i++)
{
scanf("%d",&list[i]);
}
printf("Entered Numbers Are:\n");
for(i=0;i<5;i++)
{
printf("%d ",list[i]);
}
printf("Enter item to be selected:\n");
scanf("%d",&item);
for(i=0;i<5;i++)
{
if(item==list[i])
{
printf("item found at postion:%d\n",i+1);
printf("founded item is:%d\n",list[i]);
return;
}
}
printf("item does not exist\n");
}
No comments:
Post a Comment