0
I have doubt in the following code..the value of p and j is not getting incremented after each iteration.what should I do?
for(int y=0;y<2;y++) { int p=0,j=4, l=8,mid=8; for(int i=p;i<j;i++) { if(mid==1) mid=1; else mid=mid/2; if(a[i]=='0') l=l-mid; //8-4,4-2,2-1 else l=l+mid; } if(l>=1) l--; cout<<ar[l]; p=p+4; j=j+4; }
4 Respuestas
+ 5
aman rana
What is your array elements
how many elements it has..??
https://code.sololearn.com/c74p8UVgYi5j/?ref=app
+ 4
aman rana
what is the z value..?
show your full attempt . then will help you.
(or)
{
\\maintain curly brases to if and else statements for code readability
}
0
Wait I will put it again
0
Now see