#include using namespace std;int main(){ int a[100],n,i,item,loc=0; cout<"enter number="" of="" elements:="">"enter> cin>>n; cout<"\nenter>"\nenter> for(i=1;i<> { cin>>a[i]; } cout<"\nenter number="" to="">"\nenter> cin>>item; for(i=1;i<> { if(item==a[i]) { loc=i; break; } } if(loc>0) { cout<><" is="" the="" location="" of="">"> } else cout<"\nno. not="">"\nno.>}Q: edit the code that shows after how many number of iteration searched value is found
using namespace std;
int main(){ int a[100],n,i,item,loc=0; cout<"enter number="" of="" elements:="">"enter> cin>>n; cout<"\nenter>"\nenter> for(i=1;i<> { cin>>a[i]; } cout<"\nenter number="" to="">"\nenter> cin>>item; for(i=1;i<> { if(item==a[i]) { loc=i; break; } } if(loc>0) { cout<><" is="" the="" location="" of="">"> } else cout<"\nno. not="">"\nno.>}
Q: edit the code that shows after how many number of iteration searched value is found
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here