0
I want to write a program that takes the value of the user if it is in the arrays to show the array number if it does not respon
2 Réponses
0
int i,ch;flag=0;
printf("enter no. to be searched in array:");
scanf(%d,&ch);
for(i=0;i<arr.length();i++)
{
if(ch==arr[i])
{
printf("\n The no %d is at location %d",ch,i+1);
flag=1;
break;
}
if(flag!=1)
printf("element not in array");
0
java