0
Can anyone explain working of this code(dry run)
#include <iostream> using namespace std; int main() { int array[10],i,num,n,c=0,pos; cout<<"entr the array size:\n" ; cin>>n; cout<<"enter array elements\n"; for(i=0;i<n;i++) { cin>>array[i]; } cout<<"enter no to be searched\n"; cin>>num; for(i=0;i<n;i++) { if (array[i]==num) { c=1; pos=i+1; break; } } if (c==0) { cout<<"no not found"; } else { cout<<num<<"no fond at pos"<<pos; } return 0; }
1 Answer
+ 7
Dry run to the code of USMAN ZAFER
I have click picture of my notebook
see my post on activity feed above is heading