bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

commit e67c37eeb3541be5e5555d963cd54c066d89b772
parent 1ac322c3215b797258c85dbbdb8b8a8c764b05d2
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Thu, 23 Oct 2025 19:43:46 +0530

new index/luc

Diffstat:
Mdocs/index.html | 103++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mletusc/luc041.c | 26+++++++++++++++++++++++---
Aletusc/luc042.c | 39+++++++++++++++++++++++++++++++++++++++
3 files changed, 159 insertions(+), 9 deletions(-)

diff --git a/docs/index.html b/docs/index.html @@ -720,7 +720,7 @@ int main() <div class="flex items-center"> <svg class="w-6 h-6 text-blue-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg> <span class="font-medium text-gray-800">letusc</span> - <span class="ml-2 text-sm text-gray-500">(50 files)</span> + <span class="ml-2 text-sm text-gray-500">(52 files)</span> </div> <div class="flex items-center space-x-4"> <a href="https://github.com/notamitgamer/bsc/tree/main/letusc" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" onclick="event.stopPropagation()" title="View folder on GitHub"> @@ -2597,7 +2597,7 @@ int main() (x-1)/x + 1/2 ((x-1)/x)^2 + 1/2 ((x-1)/x)^3 + 1/2 ((x-1)/x)^4 + ... If x is input through the keyboard, write a program to calculate the sum of the first seven terms of this series. */ -/* Author - Amit Dutta, Date - 21th OCT, 2025 */ +/* Author - Amit Dutta, Date - 21st OCT, 2025 */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(d) */ #include &lt;stdio.h&gt; @@ -2639,7 +2639,7 @@ int main() <div id="code-letusc-luc038_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/letusc/luc038.c"> <pre><code class="language-c">/* Write a program to generate all Pythagorean Triplets with slide length less than or equal to 30. */ -/* Author - Amit Dutta, Date - 21th OCT, 2025 */ +/* Author - Amit Dutta, Date - 21st OCT, 2025 */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(e) */ #include &lt;stdio.h&gt; @@ -2682,7 +2682,7 @@ int main() steadily at the rate of 10% per year for last 10 years. Write a program to determine the population at the end of each year in the last decade. */ -/* Author - Amit Dutta, Date - 21th OCT, 2025 */ +/* Author - Amit Dutta, Date - 21st OCT, 2025 */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(f) */ #include &lt;stdio.h&gt; @@ -2716,7 +2716,7 @@ int main() expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit. */ -/* Author - Amit Dutta, Date - 22th OCT, 2025 */ +/* Author - Amit Dutta, Date - 22nd - 23rd OCT, 2025 */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ // 1. INCLUDE SECTION @@ -2859,7 +2859,7 @@ int main() expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit. */ -/* Author - Amit Dutta, Date - 22th OCT, 2025 */ +/* Author - Amit Dutta, Date - 22nd - 23rd OCT, 2025 */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ #include &lt;stdio.h&gt; @@ -2926,6 +2926,97 @@ int main() <li> <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200"> <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg> + <span class="text-gray-700">luc041.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/letusc/luc041.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub"> + <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg> + </a> + <button onclick="showCode('code-letusc-luc041_c', 'luc041.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-letusc-luc041_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/letusc/luc041.c"> + <pre><code class="language-c">/* Write a program to print 24 hours of day with suitable suffixes like +AM, PM, Noon and Midnight. */ +/* Author - Amit Dutta, Date - 23rd OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(h) */ + +#include &lt;stdio.h&gt; +int main() +{ + int hour, temp; + printf(&quot;Time \tSuffix\n&quot;); + for (int hour = 0; hour &lt;= 23; hour++) + { + if (hour == 0) + printf(&quot;12:00\tAM (Midnight)\n&quot;); + else if (hour == 12) + printf(&quot;12:00\tPM (Noon)\n&quot;); + else if (hour &gt;= 1 &amp;&amp; hour &lt;= 11) + printf(&quot;%02d:00\tAM\n&quot;, hour); + else if (hour &gt;= 13 &amp;&amp; hour &lt;= 23) + printf(&quot;%02d:00\tPM\n&quot;, hour - 12); + } + return 0; +}</code></pre> + </div> + </li> + + <li> + <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200"> + <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg> + <span class="text-gray-700">luc042.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/letusc/luc042.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub"> + <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.168 6.839 9.492.5.092.682-.217.682-.482 0-.237-.009-.868-.014-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.031-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.03 1.595 1.03 2.688 0 3.848-2.338 4.695-4.566 4.942.359.308.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.001 10.001 0 0022 12c0-5.523-4.477-10-10-10z" clip-rule="evenodd"></path></svg> + </a> + <button onclick="showCode('code-letusc-luc042_c', 'luc042.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-letusc-luc042_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/letusc/luc042.c"> + <pre><code class="language-c">/* Write a program to produce the following output : + 1 + 2 3 + 4 5 6 +7 8 9 10 +*/ + +/* Author - Amit Dutta, Date - 23rd OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(i) */ + +#include &lt;stdio.h&gt; +int main() +{ + int starter = 1; + int tab = 3; + printf(&quot;The pattern : \n&quot;); + for (int i = 1; i &lt;= 4; i++) + { + int count = 0; + for (int k = 1; k &lt;= tab; k++) + { + printf(&quot; &quot;); + } + tab = tab - 1; + for (int j = starter; j &lt;= 10; j++) + { + if (count &gt;= i) + { + break; + } + printf(&quot;%d &quot;, j); + count++; + starter++; + } + printf(&quot;\n&quot;); + } + return 0; +}</code></pre> + </div> + </li> + + <li> + <div class="flex items-center p-3 pl-8 hover:bg-gray-50 transition-colors duration-200"> + <svg class="w-6 h-6 text-green-500 mr-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg> <span class="text-gray-700">lucproblem001.c</span> <div class="ml-auto flex items-center space-x-4"> <a href="https://github.com/notamitgamer/bsc/blob/main/letusc/lucproblem001.c" target="_blank" class="p-1 rounded-full text-gray-500 hover:bg-gray-200 hover:text-gray-800 transition-colors" title="View file on GitHub"> diff --git a/letusc/luc041.c b/letusc/luc041.c @@ -1,3 +1,23 @@ -/* Write */ +/* Write a program to print 24 hours of day with suitable suffixes like +AM, PM, Noon and Midnight. */ /* Author - Amit Dutta, Date - 23rd OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(h) */- \ No newline at end of file +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(h) */ + +#include <stdio.h> +int main() +{ + int hour, temp; + printf("Time \tSuffix\n"); + for (int hour = 0; hour <= 23; hour++) + { + if (hour == 0) + printf("12:00\tAM (Midnight)\n"); + else if (hour == 12) + printf("12:00\tPM (Noon)\n"); + else if (hour >= 1 && hour <= 11) + printf("%02d:00\tAM\n", hour); + else if (hour >= 13 && hour <= 23) + printf("%02d:00\tPM\n", hour - 12); + } + return 0; +}+ \ No newline at end of file diff --git a/letusc/luc042.c b/letusc/luc042.c @@ -0,0 +1,38 @@ +/* Write a program to produce the following output : + 1 + 2 3 + 4 5 6 +7 8 9 10 +*/ + +/* Author - Amit Dutta, Date - 23rd OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(i) */ + +#include <stdio.h> +int main() +{ + int starter = 1; + int tab = 3; + printf("The pattern : \n"); + for (int i = 1; i <= 4; i++) + { + int count = 0; + for (int k = 1; k <= tab; k++) + { + printf(" "); + } + tab = tab - 1; + for (int j = starter; j <= 10; j++) + { + if (count >= i) + { + break; + } + printf("%d ", j); + count++; + starter++; + } + printf("\n"); + } + return 0; +}+ \ No newline at end of file
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror