#include <stdio.h>
int main() {
int data[7] = {128, 128, 192, 192, 192, 320, 320};
int num = 200;
int low,high,mid;
low = 0;
high = 6;
while(low <= high){
mid = (low + high) / 2;
if(num < data[mid]){
printf("%d ",mid);
return 0;
}
else if(num > data[mid]){
low = mid + 1;
}
else if(num < data[mid]){
high = mid - 1;
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: