Write a c program to search page 11 in a book where you don’t visit every page from 1 to 50. You open any random page in the book and check its page number. If the current page number is greater than 11, then 11 is on the left side of the current page.
#include<stdio.h>
int main(){
int n;
printf("Enter a random page number\n");
scanf("%d", &n);
if(n>11){
printf("Page 11 is on the left side of the current page");
}
else{
printf("Page 11 is on the right side of the current page");
}
}
Comments
Leave a comment