You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: weeklycontent.html
+47-47Lines changed: 47 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -2736,18 +2736,18 @@ <h3>1. What are header files in C programming?</h3>
2736
2736
<ol>
2737
2737
<li>Files that contain the main function</li>
2738
2738
<li>Files that are executed before the program runs</li>
2739
-
<li>Files that contain function declarations and macros</li>
2739
+
<li><strong>Files that contain function declarations and macros</strong></li>
2740
2740
<li>Files used for memory allocation</li>
2741
2741
</ol>
2742
2742
</div>
2743
2743
2744
2744
<divclass="content-block">
2745
2745
<h3>2. Which of the following appears valid at first glance but is actually an invalid variable declaration in C?</h3>
2746
2746
<ol>
2747
-
<li>`char str[20] = "Hello";`</li>
2748
-
<li>`int @salary = 5000;`</li>
2749
-
<li>`float salary2025 = 99999.99;`</li>
2750
-
<li>`int NumberOfStudents = 50;`</li>
2747
+
<li>char str[20] = "Hello";</li>
2748
+
<li><strong>int @salary = 5000;</strong></li>
2749
+
<li>float salary2025 = 99999.99;</li>
2750
+
<li>int NumberOfStudents = 50;</li>
2751
2751
</ol>
2752
2752
</div>
2753
2753
@@ -2766,7 +2766,7 @@ <h3>3. What could be the outcome when the following C program is compiled and ex
2766
2766
<ol>
2767
2767
<li>It prints Hello, World! to the screen.</li>
2768
2768
<li>It throws a compilation error due to missing semicolon.</li>
2769
-
<li>It prints Hello, World!\n as-is, including \n.</li>
2769
+
<li><strong>It prints Hello, World!\n as-is, including \n.</strong></li>
2770
2770
<li>It waits for user input before printing anything.</li>
2771
2771
</ol>
2772
2772
</div>
@@ -2776,7 +2776,7 @@ <h3>4. A programmer wants to create a custom data type to represent a person's d
2776
2776
<ol>
2777
2777
<li>Arrays</li>
2778
2778
<li>Pointers</li>
2779
-
<li>Structures</li>
2779
+
<li><strong>Structures</strong></li>
2780
2780
<li>Functions</li>
2781
2781
</ol>
2782
2782
</div>
@@ -2787,17 +2787,17 @@ <h3>5. Which of the following is *NOT* a valid category of functions in C?</h3>
2787
2787
<li>Library Functions</li>
2788
2788
<li>User-Defined Functions</li>
2789
2789
<li>Recursive Functions</li>
2790
-
<li>Loop-Control Functions</li>
2790
+
<li><strong>Loop-Control Functions</strong></li>
2791
2791
</ol>
2792
2792
</div>
2793
2793
2794
2794
<divclass="content-block">
2795
2795
<h3>6. Which of the following is NOT a control structure in C?</h3>
2796
2796
<ol>
2797
-
<li>`if-else`</li>
2798
-
<li>`for` loop</li>
2799
-
<li>`switch`</li>
2800
-
<li>`print`</li>
2797
+
<li>if-else</li>
2798
+
<li>for loop</li>
2799
+
<li>switch</li>
2800
+
<li><strong>print</strong></li>
2801
2801
</ol>
2802
2802
</div>
2803
2803
@@ -2830,7 +2830,7 @@ <h3>7. Which of the following code snippets will cause an error or unexpected be
2830
2830
printf("20 or more");
2831
2831
</code></pre>
2832
2832
<ol>
2833
-
<li>A</li>
2833
+
<li><strong>A</strong></li>
2834
2834
<li>B</li>
2835
2835
<li>C</li>
2836
2836
<li>D</li>
@@ -2854,7 +2854,7 @@ <h3>8. What could be a possible behavior when this C program runs?</h3>
2854
2854
</code></pre>
2855
2855
<ol>
2856
2856
<li>It will print "Value at ptr: 10" and then "Value at ptr after increment: 11".</li>
2857
-
<li>It will print "Value at ptr: 10" and then "Value at ptr after increment: 20".</li>
2857
+
<li><strong>It will print "Value at ptr: 10" and then "Value at ptr after increment: 20".</strong></li>
2858
2858
<li>It will cause a segmentation fault because `ptr` is incremented.</li>
2859
2859
<li>It will print the memory addresses of the array elements.</li>
2860
2860
</ol>
@@ -2865,7 +2865,7 @@ <h3>9. A structure in C has a char member followed by an int member. However, th
2865
2865
<ol>
2866
2866
<li>The structure is packed tightly in memory.</li>
2867
2867
<li>The structure is aligned to a 4-byte boundary.</li>
2868
-
<li>The structure has extra padding for memory alignment.</li>
2868
+
<li><strong>The structure has extra padding for memory alignment.</strong></li>
2869
2869
<li>The structure is compressed to reduce its size.</li>
2870
2870
</ol>
2871
2871
</div>
@@ -2875,18 +2875,18 @@ <h3>10. What is the main characteristic of a do...while loop compared to a while
2875
2875
<ol>
2876
2876
<li>It checks the condition before executing the loop body</li>
2877
2877
<li>It never executes if the condition is false</li>
2878
-
<li>It executes the loop body at least once before checking the condition</li>
2878
+
<li><strong>It executes the loop body at least once before checking the condition</strong></li>
2879
2879
<li>It cannot use break statements</li>
2880
2880
</ol>
2881
2881
</div>
2882
2882
2883
2883
<divclass="content-block">
2884
2884
<h3>11. Which keyword is used to return a value from a function?</h3>
2885
2885
<ol>
2886
-
<li>`return`</li>
2887
-
<li>`send`</li>
2888
-
<li>`break`</li>
2889
-
<li>`exit`</li>
2886
+
<li><strong>return</strong></li>
2887
+
<li>send</li>
2888
+
<li>break</li>
2889
+
<li>exit</li>
2890
2890
</ol>
2891
2891
</div>
2892
2892
@@ -2903,7 +2903,7 @@ <h3>12. What will be the output of the following C code?</h3>
2903
2903
}
2904
2904
</code></pre>
2905
2905
<ol>
2906
-
<li>1 2 3 0 0</li>
2906
+
<li><strong>1 2 3 0 0</strong></li>
2907
2907
<li>1 2 3 garbage garbage</li>
2908
2908
<li>Compilation error</li>
2909
2909
<li>1 2 3 4 5</li>
@@ -2923,7 +2923,7 @@ <h3>13. Which of the following best describes what the pointer `ptr` does in the
2923
2923
</code></pre>
2924
2924
<ol>
2925
2925
<li>It stores the value of a, not its address.</li>
2926
-
<li>It holds the address of a and can be used to access or modify a's value.</li>
2926
+
<li><strong>It holds the address of a and can be used to access or modify a's value.</strong></li>
2927
2927
<li>It points to a completely unrelated memory location.</li>
2928
2928
<li>It causes a segmentation fault when dereferenced.</li>
2929
2929
</ol>
@@ -2933,7 +2933,7 @@ <h3>13. Which of the following best describes what the pointer `ptr` does in the
2933
2933
<h3>14. A programmer wants to store a flag that can have one of three possible values (0, 1, or 2) in a structure. What feature of C structures can be used to optimize memory usage in this case?</h3>
2934
2934
<ol>
2935
2935
<li>Bitwise operations</li>
2936
-
<li>Bit fields</li>
2936
+
<li><strong>Bit fields</strong></li>
2937
2937
<li>Unions</li>
2938
2938
<li>Enumerations</li>
2939
2939
</ol>
@@ -2942,10 +2942,10 @@ <h3>14. A programmer wants to store a flag that can have one of three possible v
2942
2942
<divclass="content-block">
2943
2943
<h3>15. What is the correct way to declare a pointer to a function that returns `int` and takes two `int` parameters?</h3>
2944
2944
<ol>
2945
-
<li>`int *func(int, int);`</li>
2946
-
<li>`int (*func)(int, int);`</li>
2947
-
<li>`int (*func(int, int));`</li>
2948
-
<li>`(*int func)(int, int);`</li>
2945
+
<li>int *func(int, int);</li>
2946
+
<li><strong>int (*func)(int, int);</strong></li>
2947
+
<li>int (*func(int, int));</li>
2948
+
<li>(*int func)(int, int);</li>
2949
2949
</ol>
2950
2950
</div>
2951
2951
@@ -2962,7 +2962,7 @@ <h3>16. What is the output of this code?</h3>
2962
2962
</code></pre>
2963
2963
<ol>
2964
2964
<li>Address of a</li>
2965
-
<li>10</li>
2965
+
<li><strong>10</strong></li>
2966
2966
<li>Compilation error</li>
2967
2967
<li>0</li>
2968
2968
</ol>
@@ -2982,7 +2982,7 @@ <h3>17. What will be the output of the following C code?</h3>
2982
2982
</code></pre>
2983
2983
<ol>
2984
2984
<li>Techie</li>
2985
-
<li>chie</li>
2985
+
<li><strong>chie</strong></li>
2986
2986
<li>hie</li>
2987
2987
<li>Compilation error</li>
2988
2988
</ol>
@@ -3006,15 +3006,15 @@ <h3>18. What will happen if the file "myfile.txt" cannot be opened in write mode
3006
3006
<ol>
3007
3007
<li>The program will skip writing and directly read from the file.</li>
3008
3008
<li>The program will crash without any message.</li>
3009
-
<li>The program will display "Error opening file!" and exit.</li>
3009
+
<li><strong>The program will display "Error opening file!" and exit.</strong></li>
3010
3010
<li>The program will create a backup file and continue.</li>
3011
3011
</ol>
3012
3012
</div>
3013
3013
3014
3014
<divclass="content-block">
3015
3015
<h3>19. A programmer wants to represent a person's address as part of their overall details. What feature of C structures can be used to group the address details (street, city, state, zip) together within the person's structure?</h3>
3016
3016
<ol>
3017
-
<li>Nested structures</li>
3017
+
<li><strong>Nested structures</strong></li>
3018
3018
<li>Arrays of structures</li>
3019
3019
<li>Pointers to structures</li>
3020
3020
<li>Functions that return structures</li>
@@ -3038,18 +3038,18 @@ <h3>20. What does the expression `found - str` do after `char *found = strchr(st
3038
3038
<ol>
3039
3039
<li>Adds an offset to the character pointer</li>
3040
3040
<li>Returns the memory address of 'a'</li>
3041
-
<li>Computes the index of 'a' in the string</li>
3041
+
<li><strong>Computes the index of 'a' in the string</strong></li>
3042
3042
<li>Returns a null pointer</li>
3043
3043
</ol>
3044
3044
</div>
3045
3045
3046
3046
<divclass="content-block">
3047
3047
<h3>21. How can you access structure members?</h3>
3048
3048
<ol>
3049
-
<li>Using the comma `,` operator</li>
3050
-
<li>Using the dot `.` operator</li>
3051
-
<li>Using the star `*` operator</li>
3052
-
<li>Using the at `@` operator</li>
3049
+
<li>Using the comma (,) operator</li>
3050
+
<li><strong>Using the dot (.) operator</strong></li>
3051
+
<li>Using the star (*) operator</li>
3052
+
<li>Using the at (@) operator</li>
3053
3053
</ol>
3054
3054
</div>
3055
3055
@@ -3071,7 +3071,7 @@ <h3>22. What will happen when the following code is executed?</h3>
3071
3071
}
3072
3072
</code></pre>
3073
3073
<ol>
3074
-
<li>The program creates data.txt and writes "Hello World!"</li>
3074
+
<li><strong>The program creates data.txt and writes "Hello World!"</strong></li>
3075
3075
<li>The program prints "Error opening file."</li>
3076
3076
<li>The program throws a compile-time error</li>
3077
3077
<li>The program opens the file in append mode and adds "Hello World!" at the end</li>
@@ -3096,7 +3096,7 @@ <h3>23. What will happen if "myfile.txt" does not exist when the program tries t
3096
3096
<ol>
3097
3097
<li>It creates a new empty file named "myfile.txt".</li>
3098
3098
<li>It reads from a temporary file instead.</li>
3099
-
<li>It returns NULL and prints an error message.</li>
3099
+
<li><strong>It returns NULL and prints an error message.</strong></li>
3100
3100
<li>It appends default text into the file.</li>
3101
3101
</ol>
3102
3102
</div>
@@ -3106,7 +3106,7 @@ <h3>24. A programmer wants to read data from a file in C. What is the first step
3106
3106
<ol>
3107
3107
<li>Reading data from the file using `fread()`</li>
3108
3108
<li>Closing the file using `fclose()`</li>
3109
-
<li>Opening the file using `fopen()`</li>
3109
+
<li><strong>Opening the file using `fopen()`</strong></li>
3110
3110
<li>Writing data to the file using `fwrite()`</li>
3111
3111
</ol>
3112
3112
</div>
@@ -3156,7 +3156,7 @@ <h3>25. Why is `fgets()` used for reading the student name instead of `scanf("%s
0 commit comments