-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumguesser.c
155 lines (152 loc) · 4.72 KB
/
numguesser.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include<stdio.h>
int main()
{
int sum=0,i,n,n1,n2,n3,n4,n5,n6,n7;
char k;
/*assigning the arrays
First make it in a book later apply the code,
Its a simple task to make that....*/
int a[18]={14,12,3,9,11,3,17,8,19,9,15,27,31,7,42,53,29,6};
int b[18]={9,16,0,7,23,06,6,1,0,12,75,33,52,47,2,12,13,15};
int c[18]={17,23,1,4,12,8,9,37,1,65,16,45,9,77,12,15,4,9};
int d[18]={21,34,2,9,5,39,27,2,7,19,8,40,22,61,47,23,42,7};
int e[18]={5,71,17,13,57,9,5,4,12,9,28,66,6,84,43,71,85,90};
int f[18]={42,93,0,7,63,16,23,2,91,57,0,12,1,7,89,97,53,3};
int g[18]={91,27,74,6,63,7,79,56,9,5,19,23,54,8,4,63,49,6};
printf("HI, I am PRISH I will guess your number\n\n");
printf("**********Keep a NUMBER in your mind from 1 to 9**********\n");
printf(" Press 'c' to continue\n");
scanf("%c",&k);
printf("1)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",a[i]);
}
scanf("%d",&n1);
if(n1==1)
{
sum=sum+3;
printf("2)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",b[i]);
}
scanf("%d",&n2);
}
else if(n1==0)
{
printf("2)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",b[i]);
}
scanf("%d",&n2);
}
if(n2==1)
{
sum=sum+0;
printf("3)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",c[i]);
}
scanf("%d",&n3);
}
else if(n2==0)
{
printf("3)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",c[i]);
}
scanf("%d",&n3);
}
if(n3==1)
{
sum=sum+1;
printf("4)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",d[i]);
}
scanf("%d",&n4);
}
else if(n3==0)
{
printf("4)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",d[i]);
}
scanf("%d",&n4);
}
if(n4==1)
{
sum=sum+2;
printf("5)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",e[i]);
}
scanf("%d",&n5);
}
else if(n4==0)
{
printf("5)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",e[i]);
}
scanf("%d",&n5);
}
if(n5==1)
{
sum=sum+1;
printf("6)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",f[i]);
}
scanf("%d",&n6);
}
else if(n5==0)
{
printf("6)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",f[i]);
}
scanf("%d",&n6);
}
if(n6==1)
{
sum=sum+0;
printf("7)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",g[i]);
}
scanf("%d",&n7);
}
else if(n6==0)
{
printf("7)PRESS '1' if your number is present in this column else PRESS '0'...\n");
for(i=0;i<18;i++)
{
printf("\t---> %d\n",g[i]);
}
scanf("%d",&n7);
}
if(n7==1)
{
sum=sum+2;
printf("The number which is in you mind is %d\n\n ",sum);
printf("If you say I am incorrect PLEASE PASS MY TEST CAREFULLY\n\n\n");
}
else if(n7==0)
{
printf("The number which is in you mind is %d\n\n",sum);
printf("\t\tIf you say I am incorrect PLEASE PASS MY TEST CAREFULLY\n\n\n");
}
}
//end of project......