-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythonmcq-4.html
More file actions
440 lines (349 loc) · 12.8 KB
/
pythonmcq-4.html
File metadata and controls
440 lines (349 loc) · 12.8 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<!doctype html>
<html lang="en-US">
<head>
<title>DataCode.in</title>
<!-- Required meta tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- required Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:200,300,400,600,700,800" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
<!-- required CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/all.min.css" />
<link rel="stylesheet" href="https://shrikant9907.github.io/webstyle/webstyle.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/responsive.css" />
</head>
<body class="f_16_22">
<header id="main_header" class="fixed-top">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="site_logo">
<a class="d-block line_height_0" href="index.html"> <span class="logo_text p_t_10 text-white"><strong>DATA</strong>CODE</span>
</a>
</div>
</div>
<div class="col-md-9 text-right header_mobile_control">
<div class="header_menus">
<nav class="navbar navbar-expand-lg">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"><i class="fas fa-bars"></i></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item"> <a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item"> <a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item dropdown "> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="/tutorials" role="button" aria-haspopup="true" aria-expanded="false">Languages</a>
<div class="dropdown-menu"> <a class="dropdown-item" href="codingquestionswithsolution.html">C</a>
<a class="dropdown-item" href="/c++.html">C++</a>
<a class="dropdown-item" href="/java.html">Java</a>
<a class="dropdown-item" href="/python.html">Python</a>
<a class="dropdown-item" href="/https://datacode25.blogspot.com/">Blog</a>javascripthttps://datacode25.blogspot.com/">Blog</a>.html">JavaScript</a>
<a class="dropdown-item" href="/html-and-css.html">Html & Css</a>
</div>
</li>
<li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="/tutorials" role="button" aria-haspopup="true" aria-expanded="false">Technologies</a>
<div class="dropdown-menu"> <a class="dropdown-item" href="/latest-technology.html">Latest Technology</a>
<a class="dropdown-item" href="/machine-learning.html">Machine Learning</a>
<a class="dropdown-item" href="/data-science.html">Data Science</a>
</div>
</li>
<li class="nav-item"> <a class="nav-link" href="https://datacode25.blogspot.com/">Blog</a>
</li>
<li class="nav-item"> <a class="nav-link" href="/contact.html">Contact</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
</header>
<div class="banner">
</div>
<br>
<br>
<br>
<section>
<div class="container">
<h2 class="mb-4">Python MCQs</h2>
<br>
<h5>Q1. What will be the output ? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
{
float f = 0.1;
if (f == 0.1)
printf("YES\n");
else
printf("NO\n");
return 0;
}
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: No</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q2. What will be the output of the following C code? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
void main()
{
int x = 0, y = 2, z = 3;
int a = x & y | z;
printf("%d", a);
}
<h5 style="color:#03a9f4">Options:</h5>
a) 3
b) 0
c) 2
d) Run time error
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: A</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q3.What will be the output of the following C code? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
void main()
{
int a = 3;
int b = ++a + a++ + --a;
printf("Value of b is %d", b);
}
<h5 style="color:#03a9f4">Options</h5>
a) Value of x is 12
b) Value of x is 13
c) Value of x is 10
d) Undefined behaviour.
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: D</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q4.What will be the output of the following C code? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
int main()
{
int a = 10;
double=5.6;
int c;
c = a + b;
printf("%d", c);
}
<h5 style="color:#03a9f4">Options</h5>
a) 15
b) 16
c) 15.6
d) 10
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: A</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q5. What will be the output ? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
int main()
{
int a = 10, b = 5, c = 5;
int d;
d = a == (b + c);
printf("%d", d);
}
<h5 style="color:#03a9f4">Options</h5>
a) Syntax error
b) 1
c) 10
d) 5
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: C</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q6. What will be the output ? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
int main()
{
int i = 3;
int l = i / -2;
int k = i % -2;
printf("%d %d\n", l, k);
return 0;
}
<h5 style="color:#03a9f4">Options</h5>
a) Compile time error
b) -1 1
c) 1 -1
d) Implementation defined
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: B</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q7. What will be the final value of x in the following C code?
</h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
void main()
{
int x = 5 * 9 / 3 + 9;
}
<h5 style="color:#03a9f4">Options</h5>
a) 3.75
b) Depends on compiler
c) 24
d) 3
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: C</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q8. What will be the final value of d in the following C code?
</h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
int main()
{
int a = 10, b = 5, c = 5;
int d;
d = b + c == a;
printf("%d", d);
}
<h5 style="color:#03a9f4">Options</h5>
a) Syntax error
b) 1
c) 5
d) 10
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: B</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q9. What will be the output ? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: -1px;">
void main()
{
float x =0.1;
if (x == 0.1)
printf(“Datacode");
else
printf("Advanced C Classes");
}
<h5 style="color:#03a9f4"> Options:</h5>
a) Advanced C Classes
b) Datacode
c) Run time error
d) Compile time error
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: A</h5>
</div>
</div>
<br>
<br>
<br>
<h5>Q10. What will be the output ? </h5><BR>
<pre style="border:3px; border-style:solid; border-color:#03a9f4; padding: 1em;">
int main()
{
int a = 10, b = 10;
If (a = 5) b--;
printf("%d, %d", a, b--);
}
<h5 style="color:#03a9f4">Options</h5>
a) a = 10, b = 9
b) a = 10, b = 8
c) a = 5, b = 9
d) a = 5, b = 8
</pre>
<div class="dropdown">
<button class="dropbtn" style="background-color:#03a9f4 ; height:50px; width:200px">Check Answer : </button>
<div class="dropdown-content">
<h5>Ans: B</h5>
</div>
</div>
</div>
</section>
<br>
<br>
<br>
<footer class="footer_style1 p_t_60 f_14_18">
<div class="container">
<div class="row">
<div class="col-md-8">
<h3 class="widget-title f_20_26 m_b_20 text-uppercase">Social</h3>
<ul class="list-unstyled footer-social">
<li class="d-inline-block mr-3"><a href="#"><i class="fab fa-facebook-f" color="white" style="font-size:30px"></i> </a></li>
<li class="d-inline-block mr-3"><a href="#"><i class="fab fa-instagram" color="white" style="font-size:30px"></i> </a></li>
<li class="d-inline-block mr-3"><a href="#"><i class="fab fa-youtube" color="white" style="font-size:30px"> </i> </a></li>
<li class="d-inline-block mr-3"><a href="#"><i class="fab fa-linkedin" color="white" style="font-size:30px"></i> </a></li>
<!-- <li class="d-inline-block mr-3"><a href="#"><span class="fa fa-vimeo" color="white" style="font-size:30px"></span> </a></li>
<li class="d-inline-block"><a href="#"><span class="fa fa-snapchat" color="white" style="font-size:30px"></span> </a></li>-->
</ul>
</div>
<div class="col-md-13">
<h4 class="widget-title f_20_26 m_b_20 text-uppercase">For Help and Support Contact :</h4>
<div class="menu-help-and-support-container">
<ul id="menu-help-and-support" class="menu">
<li id="menu-item-285" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-285"><a href="/contact.html" style="color:white"><h6>datacode.in@gmail.com</h6></a>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class=" col-12 col-md-6 text-left p_y_30">Copy © 2018. All rights reserved.</div>
<!-- <div class="col-12 col-md-6 text-right p_y_30">Designed by - Akash and Team.</div>-->
</div>
</div>
</footer>
<script type='text/javascript' src='js/jquery.min.js'></script>
<script type='text/javascript' src='js/jquery-migrate.min.js'></script>
<script type='text/javascript' src='js/popper.min.js'></script>
<script type='text/javascript' src='js/bootstrap.min.js'></script>
<script type='text/javascript' src='js/all.min.js'></script>
<script type='text/javascript' src='js/custom.js'></script>
</body>
</html>