Skip to content

Commit 2059418

Browse files
Update quiz.html
1 parent ed25abc commit 2059418

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

quiz.html

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -494,58 +494,51 @@ <h2>BRAIN CACHE</h2>
494494
<h3>Quiz Questions</h3>
495495

496496
<div class="form-group no-select">
497-
<p><strong>1. Which is true about the const keyword in C?</strong></p>
497+
<p><strong>1. What is the output of the following C code snippet?</strong></p>
498+
<pre><code>int x = 10;
499+
printf("%d", ++x);</code></pre>
498500
<div class="radio-group">
499-
<label><input type="radio" id="q1_a" name="Question1" value="A" required>A. It creates a constant pointer.</label>
500-
<label><input type="radio" id="q1_b" name="Question1" value="B">B. It prevents modification of the value it points to.</label>
501-
<label><input type="radio" id="q1_c" name="Question1" value="C">C. It can be changed using pointer tricks.</label>
502-
<label><input type="radio" id="q1_d" name="Question1" value="D">D. It's the same as #define</label>
501+
<label><input type="radio" id="q1_a" name="Question1" value="A" required>A. 10</label>
502+
<label><input type="radio" id="q1_b" name="Question1" value="B">B. 11</label>
503+
<label><input type="radio" id="q1_c" name="Question1" value="C">C. Undefined behavior</label>
504+
<label><input type="radio" id="q1_d" name="Question1" value="D">D. Compiler error</label>
503505
</div>
504506
</div>
505507

506508
<div class="form-group no-select">
507-
<p><strong>2. What is wrong with this loop?</strong></p>
508-
<pre><code>for (int i = 0; i < 10; i--);</code></pre>
509+
<p><strong>2. Which header file must be included to use `malloc()` and `free()` functions in C?</strong></p>
509510
<div class="radio-group">
510-
<label><input type="radio" id="q2_a" name="Question2" value="A" required>A. i should be declared outside.</label>
511-
<label><input type="radio" id="q2_b" name="Question2" value="B">B. Semicolon is missing.</label>
512-
<label><input type="radio" id="q2_c" name="Question2" value="C">C. Infinite loop.</label>
513-
<label><input type="radio" id="q2_d" name="Question2" value="D">D. Nothing wrong.</label>
511+
<label><input type="radio" id="q2_a" name="Question2" value="A" required>A. `stdio.h`</label>
512+
<label><input type="radio" id="q2_b" name="Question2" value="B">B. `string.h`</label>
513+
<label><input type="radio" id="q2_c" name="Question2" value="C">C. `stdlib.h`</label>
514+
<label><input type="radio" id="q2_d" name="Question2" value="D">D. `math.h`</label>
514515
</div>
515516
</div>
516517

517518
<div class="form-group no-select">
518-
<p><strong>3. Which of the following statements correctly frees memory allocated by malloc in C?</strong></p>
519+
<p><strong>3. What is the purpose of the `break` statement in C?</strong></p>
519520
<div class="radio-group">
520-
<label><input type="radio" id="q3_a" name="Question3" value="A" required>A. deallocate(p);</label>
521-
<label><input type="radio" id="q3_b" name="Question3" value="B">B. free(p);</label>
522-
<label><input type="radio" id="q3_c" name="Question3" value="C">C. delete p;</label>
523-
<label><input type="radio" id="q3_d" name="Question3" value="D">D. release(p);</label>
521+
<label><input type="radio" id="q3_a" name="Question3" value="A" required>A. To exit the program.</label>
522+
<label><input type="radio" id="q3_b" name="Question3" value="B">B. To skip the current iteration of a loop.</label>
523+
<label><input type="radio" id="q3_c" name="Question3" value="C">C. To terminate a loop or switch statement.</label>
524+
<label><input type="radio" id="q3_d" name="Question3" value="D">D. To jump to a specific label.</label>
524525
</div>
525526
</div>
526527

527528
<div class="form-group no-select">
528-
<p><strong>4. Spot the logical error:</strong></p>
529-
<pre><code>while (1 == 1); {
530-
printf("Hi");
531-
}</code></pre>
529+
<p><strong>4. In C, what does `sizeof(char)` typically return?</strong></p>
532530
<div class="radio-group">
533-
<label><input type="radio" id="q4_a" name="Question4" value="A" required>A. Infinite loop prints "Hi" repeatedly.</label>
534-
<label><input type="radio" id="q4_b" name="Question4" value="B">B. Syntax error.</label>
535-
<label><input type="radio" id="q4_c" name="Question4" value="C">C. Semicolon ends the loop before block.</label>
536-
<label><input type="radio" id="q4_d" name="Question4" value="D">D. Nothing wrong.</label>
531+
<label><input type="radio" id="q4_a" name="Question4" value="A" required>A. 0 bytes</label>
532+
<label><input type="radio" id="q4_b" name="Question4" value="B">B. 1 byte</label>
533+
<label><input type="radio" id="q4_c" name="Question4" value="C">C. 2 bytes</label>
534+
<label><input type="radio" id="q4_d" name="Question4" value="D">D. 4 bytes</label>
537535
</div>
538536
</div>
539-
537+
540538
<div class="form-group no-select">
541-
<p><strong>5. Give a c program to print the pattern:</strong></p>
542-
<pre><code>1
543-
2 3
544-
4 5 6
545-
7 8 9 10</code></pre>
546-
<textarea id="q5_ans" name="Question5" rows="4" required placeholder="Type your answer here..."></textarea>
539+
<p><strong>5. Write a C program to swap two numbers without using a third variable.</strong></p>
540+
<textarea id="q5_ans" name="Question5" rows="6" required placeholder="Type your C code here..."></textarea>
547541
</div>
548-
549542

550543
<p><strong>After submission wait until you see a tick</strong></p>
551544
<button type="submit" class="submit-button">Submit Quiz</button>
@@ -580,7 +573,7 @@ <h3>Quiz Questions</h3>
580573
<script>
581574
// --- CONTROL KEYWORD HERE ---
582575
// Change this variable to "disable" or "enable"
583-
const linkControlStatus = "disable"; // Set to "enable" to activate links
576+
const linkControlStatus = "enable"; // Set to "enable" to activate links
584577
// --- END CONTROL KEYWORD ---
585578

586579
// --- TIMER CONTROL KEYWORD HERE ---
@@ -678,19 +671,19 @@ <h3>Quiz Questions</h3>
678671
// Priority 1: Manual override via linkControlStatus
679672
if (linkControlStatus === "enable") {
680673
quizShouldBeEnabled = true;
681-
statusElement.innerHTML = 'BRAIN CACHE - WEEK 8 QUIZ<br>fill within 5/7/25 6.00 PM IST!'; // Indicate manual override
674+
statusElement.innerHTML = 'BRAIN CACHE - QUIZ<br>fill within 27/7/25 6.00 PM IST!'; // Indicate manual override
682675
statusElement.style.color = '#008000'; // Green
683676
}
684677
// Priority 2: Timer control, if enabled
685678
else if (timerControlStatus === "enable") {
686679
if (currentTime >= quizStartTime && currentTime < quizEndTime) {
687680
quizShouldBeEnabled = true;
688-
statusElement.innerHTML = 'BRAIN CACHE - WEEK 8 QUIZ<br>Quiz is LIVE! Ends on 06/07/2025 6:00 PM IST!';
681+
statusElement.innerHTML = 'BRAIN CACHE - QUIZ<br>Quiz is LIVE! Ends on 27/7/2025 6:00 PM IST!';
689682
statusElement.style.color = '#008000'; // Green for active
690683
} else if (currentTime < quizStartTime) {
691684
// Quiz not yet started
692685
quizShouldBeEnabled = false;
693-
statusElement.innerHTML = 'BRAIN CACHE - WEEK 8 QUIZ<br>wait for updates!';
686+
statusElement.innerHTML = 'BRAIN CACHE - QUIZ<br>wait for updates!';
694687
statusElement.style.color = '#FFA500'; // Orange for upcoming
695688
} else {
696689
// Quiz ended

0 commit comments

Comments
 (0)