|
11 | 11 | <title>Welcome to Virtual Labs - A MHRD Govt of india Initiative</title> |
12 | 12 |
|
13 | 13 | <link rel="shortcut icon" href="../images/favicon.ico"> |
14 | | - |
| 14 | + <script type="text/javascript" src = 'quiz.js'></script> |
15 | 15 |
|
16 | 16 | <link href="../css/bootstrap.min.css" rel="stylesheet"> |
17 | 17 |
|
|
25 | 25 | <link href="../css/style.css" rel="stylesheet"> |
26 | 26 | <script type="text/javascript" src = 'tabs.js'></script> |
27 | 27 | <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-67020197-1', 'auto');ga('send', 'pageview');</script> |
| 28 | + |
| 29 | + |
| 30 | +<style> |
| 31 | +.qheader{ |
| 32 | +font:bold 14px Arial; |
| 33 | +} |
| 34 | + |
| 35 | +.qselections{ |
| 36 | +font:normal 13px Arial; |
| 37 | +} |
| 38 | +</style> |
| 39 | + |
| 40 | +<script src="quizconfig.js"> |
| 41 | +</script> |
| 42 | + |
| 43 | +<script> |
| 44 | + |
| 45 | +/*********************************************** |
| 46 | +* JavaScriptKit.com Multiple Choice Quiz Script (http://www.javascriptkit.com) |
| 47 | +* Copyright 2003 JavaScript Kit- http://www.javascriptkit.com |
| 48 | +* This notice and footnote must stay intact for use |
| 49 | +* Visit JavaScript Kit (http://www.javascriptkit.com/) for full source code |
| 50 | +***********************************************/ |
| 51 | + |
| 52 | +var actualchoices=new Array() |
| 53 | +document.cookie="ready=yes" |
| 54 | +</script> |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
28 | 59 | </head> |
29 | 60 | <body id="page-top" class="index"> |
30 | 61 | <div id="top"> |
@@ -93,14 +124,19 @@ <h2 class="text-h2-lightblue" style=" margin-bottom: 20px; margin-top: 10px; ">< |
93 | 124 | <div class="row"> |
94 | 125 | <div class="col-md-2 sidebar-col-2"> |
95 | 126 | <!--edit1--> |
96 | | -<a href="Introduction.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Introduction</h3></a><a href="Theory.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Theory</h3></a><a href="Objective.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Objective</h3></a><a href="Experiment.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Experiment</h3></a><a href="Manual.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Manual</h3></a><a href="Quizzes.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Quizzes</h3></a><a href="http://feedback.vlabs.ac.in/" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;"></h3></a> </div> |
| 127 | + <a href="Introduction.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Introduction</h3></a><a href="Theory.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Theory</h3></a><a href="Objective.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Objective</h3></a><a href="Experiment.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Experiment</h3></a><a href="Manual.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Manual</h3></a><a href="Quizzes.html?domain=Computer Science&lab=Problem Solving Lab" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;">Quizzes</h3></a><a href="http://feedback.vlabs.ac.in/" class="sidebar-a" > <h3 class="text-h3-darkblue" style="margin-top: 2px;"></h3></a> </div> |
97 | 128 |
|
98 | | - <div class="col-md-10 lab-list-col-10"> |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +<div class="col-md-10 lab-list-col-10"> |
99 | 135 |
|
100 | 136 | <!--edit --> |
101 | | -<h1 class="text-h2-lightblue">Sequences</h1><div class="content" id="experiment-article-section-6-content"> |
| 137 | +<h1 class="text-h2-lightblue">Numerical Representation</h1><div class="content" id="experiment-article-section-6-content"> |
102 | 138 | <p> |
103 | | -<form action="quizresults.php" method="post" name="quiz" onsubmit='return window.confirm("You are submitting information to an external page. \nAre you sure?");' target="_blank"> |
| 139 | +<!-- <form method="post" name="quiz" onsubmit='evaluate()' target="_blank"> |
104 | 140 | <ol> |
105 | 141 | <li><b>1. The execution of a loop typically starts with: </b></li> |
106 | 142 | <input name="Q1" type="radio" value="1">initialization statements<br> |
@@ -129,27 +165,154 @@ <h1 class="text-h2-lightblue">Sequences</h1><div class="content" id="experiment- |
129 | 165 | <input name="Q4" type="radio" value="4">None of the above<br> |
130 | 166 | <br> |
131 | 167 | <li><b>5. Which of the following is not an infinite loop. </b></li> |
132 | | -<input name="Q5" type="radio" value="1"><code>int i = 1 ; |
| 168 | +<input name="Q5" type="radio" value="1"><code>int i = 1 ; |
133 | 169 | while ( 1 ) |
134 | 170 | { |
135 | 171 | i++ ; |
136 | 172 | }</code><br> |
137 | 173 | <input name="Q5" type="radio" value="2"> |
138 | | -<code>for( int i =1; i< 10; i--) |
139 | | -printf("Hello World"); |
| 174 | +<code>for( int i =1; i < 10 ; i--) printf("Hello World"); |
140 | 175 | </code><br> |
141 | 176 | <input name="Q5" type="radio" value="3"><code>for(int i =1; i<100; i++) |
142 | 177 | printf("Hello World"); |
143 | 178 | </code><br> |
144 | | -<input name="Q5" type="radio" value="4"><code>int i = 0; |
| 179 | +<input name="Q5" type="radio" value="4"> |
| 180 | +<code>int i = 0; |
145 | 181 | do{ |
146 | 182 | i-- |
147 | 183 | printf("%d ",i); |
148 | 184 | }while(i>0); |
149 | | - </code><br> |
| 185 | +</code> |
| 186 | +</ol> |
| 187 | +<br> |
150 | 188 | </br></input></br></input></br></input></br></input></br></br></input></br></input></br></input></br></input></br></br></input></br></input></br></input></br></input></br></br></input></br></input></br></input></br></input></br></br></input></br></input></br></input></br></input></ol> |
151 | | -<p> <input target="_blank" type="submit" value="Submit answers for evaluation"/></p> |
| 189 | +<br> |
| 190 | +<p> <button type="submit" onclick="evaluate()">Submit answers for evaluation</button></p> |
| 191 | +</br></form> --> |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +<form method="POST" name="myquiz"> |
| 196 | + |
| 197 | +<!-- <font face="Arial"><big><big>General Knowledge Quiz</big></big></font></p> --> |
| 198 | + |
| 199 | +<div class="qheader"> |
| 200 | +1. The execution of a loop typically starts with: </div> |
| 201 | +<div class="qselections"> |
| 202 | +<input type="radio" value="a" name="question1">a) initialization statements<br> |
| 203 | +<input type="radio" value="b" name="question1">b) Loop body<br> |
| 204 | +<input type="radio" value="c" name="question1">c) test condition<br> |
| 205 | +<input type="radio" value="d" name="question1">d) update statements<br> |
| 206 | +</div> |
| 207 | + |
| 208 | +<br> |
| 209 | + |
| 210 | +<div class="qheader"> |
| 211 | +2) The break statement is used to exit from:</div> |
| 212 | +<div class="qselections"> |
| 213 | +<input type="radio" value="a" name="question2">a) an if statement<br> |
| 214 | +<input type="radio" value="b" name="question2">b) a for loop<br> |
| 215 | +<input type="radio" value="c" name="question2">c) a program<br> |
| 216 | +<input type="radio" value="d" name="question2">d) the main( ) function<br> |
| 217 | +</div> |
| 218 | + |
| 219 | +<br> |
| 220 | + |
| 221 | +<div class="qheader"> |
| 222 | +3) A do-while loop is useful when we want that the statements within the loop must be executed</div> |
| 223 | +<div class="qselections"> |
| 224 | +<input type="radio" value="a" name="question3">a) only once<br> |
| 225 | +<input type="radio" value="b" name="question3">b) At Least Once<br> |
| 226 | +<input type="radio" value="c" name="question3">c) More than once<br> |
| 227 | +<input type="radio" value="d" name="question3">d) None of the above<br> |
| 228 | +</div> |
| 229 | + |
| 230 | +<br> |
| 231 | + |
| 232 | +<div class="qheader"> |
| 233 | +4) In what sequence the initialization, testing and execution of body is done in a do-while loop </div> |
| 234 | +<div class="qselections"> |
| 235 | +<input type="radio" value="a" name="question4">a) Initialization, execution of body, testing<br> |
| 236 | +<input type="radio" value="b" name="question4">b) Execution of body, initialization, testing<br> |
| 237 | +<input type="radio" value="c" name="question4">c) Initialization, testing, execution of body<br> |
| 238 | +<input type="radio" value="d" name="question4">d) None of the above<br> |
| 239 | +</div> |
| 240 | + |
| 241 | +<br> |
| 242 | + |
| 243 | +<div class="qheader"> |
| 244 | +5) Which looping process checks the test condition at the end of the loop?</div> |
| 245 | +<div class="qselections"> |
| 246 | +<input type="radio" value="a" name="question5">a) for<br> |
| 247 | +<input type="radio" value="b" name="question5">b) while<br> |
| 248 | +<input type="radio" value="c" name="question5">c) do-while<br> |
| 249 | +<input type="radio" value="d" name="question5">d) No looping peocess check condition at the end<br> |
| 250 | +</div> |
| 251 | + |
| 252 | +<br> |
| 253 | + |
| 254 | +<div class="qheader"> |
| 255 | +6) A continue statement causes execution to skip to: </div> |
| 256 | +<div class="qselections"> |
| 257 | +<input type="radio" value="a" name="question6">a) the end of the program<br> |
| 258 | +<input type="radio" value="b" name="question6">b) the first statement after the loop<br> |
| 259 | +<input type="radio" value="c" name="question6">c) the statement following the continue statement<br> |
| 260 | +<input type="radio" value="d" name="question6">d) the next iteration of the loop<br> |
| 261 | +</div> |
| 262 | + |
| 263 | +<br> |
| 264 | + |
| 265 | +<div class="qheader"> |
| 266 | +7) The statement i++; is equivalent to: </div> |
| 267 | +<div class="qselections"> |
| 268 | +<input type="radio" value="a" name="question7">a) <code>i = i + i;</code><br> |
| 269 | +<input type="radio" value="b" name="question7">b) <code>i = i + 1;</code><br> |
| 270 | +<input type="radio" value="c" name="question7">c) <code>i = i - 1;</code><br> |
| 271 | +<input type="radio" value="d" name="question7">d) <code> i - - ;</code><br> |
| 272 | +</div> |
| 273 | + |
| 274 | +<br> |
| 275 | + |
| 276 | +<div class="qheader"> |
| 277 | +8) Another word for "looping" is: </div> |
| 278 | +<div class="qselections"> |
| 279 | +<input type="radio" value="a" name="question8">a) recapitulation <br> |
| 280 | +<input type="radio" value="b" name="question8">b) tintinabulation <br> |
| 281 | +<input type="radio" value="c" name="question8">c) iteration<br> |
| 282 | +<input type="radio" value="d" name="question8">d) reiteration<br> |
| 283 | +</div> |
| 284 | + |
| 285 | +<br> |
| 286 | + |
| 287 | +<div class="qheader"> |
| 288 | +9) Which looping process is best used when the number of iterations is known?</div> |
| 289 | +<div class="qselections"> |
| 290 | +<input type="radio" value="a" name="question9">a) for<br> |
| 291 | +<input type="radio" value="b" name="question9">b) while<br> |
| 292 | +<input type="radio" value="c" name="question9">c) do-while<br> |
| 293 | +<input type="radio" value="d" name="question9">d) all of the above<br> |
| 294 | +</div> |
| 295 | + |
| 296 | +<br> |
| 297 | + |
| 298 | +<div class="qheader"> |
| 299 | +10) Which of the following is not an infinite loop.</div> |
| 300 | +<div class="qselections"> |
| 301 | +<input type="radio" value="a" name="question10">a) <code>int i = 1 ; while ( 1 ) { i++ ; |
| 302 | +} </code><br> |
| 303 | +<input type="radio" value="b" name="question10">b) <code>for( int i =1; i < 10 ; i--) printf("Hello World");</code><br> |
| 304 | +<input type="radio" value="c" name="question10">c) <code>for(int i =1; i<100; i++) printf("Hello World");</code><br> |
| 305 | +<input type="radio" value="d" name="question10">d) <code>int i = 0; do{ i-- printf("%d ",i); }while(i>0);</code><br> |
| 306 | + |
| 307 | +</div> |
| 308 | + |
| 309 | +</form> |
| 310 | + |
| 311 | +<form> |
| 312 | +<div align="center"> |
| 313 | +<input type="button" value="Grade Me!" name="B1" onClick="gradeit()"> <input type="button" value="Reset" name="B2" onClick="document.myquiz.reset()"></div> |
152 | 314 | </form> |
| 315 | + |
153 | 316 | </p> |
154 | 317 | </div> </div> |
155 | 318 | </div> |
@@ -206,6 +369,8 @@ <h2 class="text-h2-lightblue-small" style="font-weight: bold;margin-top: 0px;"> |
206 | 369 |
|
207 | 370 | </div> <!-- top div --> |
208 | 371 |
|
| 372 | + |
| 373 | + |
209 | 374 | </body> |
210 | 375 |
|
211 | 376 |
|
|
0 commit comments