#include "myhdr.h" int main() { /* int sq1[] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31}; int sq2[] = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}; int sq3[] = {4,5,6,7,12,13,14,15,16,21,22,23,28,29,30,31}; int sq4[] = {8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31}; int sq5[] = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; */ int sq[5][16] = {{1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31}, {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}, {4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31}, {8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31}, {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}}; int yourNum = 0; int startNum = 1; char reply,junk; int i,j; printf(" Think of a number between 1 and 31\n"); for (i = 0; i < 5; i++) { for (j =0; j <16; j++) printf("%d ", sq[i][j]); printf("\n"); printf (" Is your number in this list\n"); scanf("%c%c", &reply,&junk); if (reply == 'y') //yourNum = yourNum + int(pow(2,i)); yourNum = yourNum + (startNum << i); } printf("Your number is %d\n", yourNum); return 0; }