bsc

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

commit 1f352fe198794627c724e7dc751ddc66b6393eaa
parent 49ddb1339462769d15ef85971e31b9e241f930c7
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Fri, 31 Oct 2025 21:12:43 +0530

updating setting.json -adding system error

Diffstat:
M.vscode/settings.json | 4+++-
Mdocs/index.html | 175++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Atuition-c/APC-PRAC-011.c | 28++++++++++++++++++++++++++++
Atuition-c/APC-PRAC-012.c | 20++++++++++++++++++++
Atuition-c/APC-PRAC-013.c | 33+++++++++++++++++++++++++++++++++
Atuition-c/APC-PRAC-014.c | 36++++++++++++++++++++++++++++++++++++
6 files changed, 294 insertions(+), 2 deletions(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json @@ -60,6 +60,8 @@ "files.associations": { "math.h": "c", "stdio.h": "c", - "ratio": "c" + "ratio": "c", + "system_error": "c", + "ctype.h": "c" } } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html @@ -3862,7 +3862,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">tuition-c</span> - <span class="ml-2 text-sm text-gray-500">(69 files)</span> + <span class="ml-2 text-sm text-gray-500">(73 files)</span> </div> <div class="flex items-center space-x-4"> <a href="https://github.com/notamitgamer/bsc/tree/main/tuition-c" 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"> @@ -4202,6 +4202,179 @@ 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">APC-PRAC-011.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-011.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-tuition-c-APC-PRAC-011_c', 'APC-PRAC-011.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-011_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-011.c"> + <pre><code class="language-c">/* Write a program to input positive number and check whether the number is +perfect square or not. If the number is negetive then display appropriate message */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + int num, temp; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (num &lt; 0) + { + printf(&quot;\nYou entered a negetive number.&quot;); + return 1; + } + temp = (int)sqrt(num); + if (temp * temp == num) + { + printf(&quot;\nInput %d is a perfect square number.&quot;, num); + return 0; + } + else + printf(&quot;\nInput %d is not a perfect square number.&quot;, num); + 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">APC-PRAC-012.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-012.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-tuition-c-APC-PRAC-012_c', 'APC-PRAC-012.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-012_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-012.c"> + <pre><code class="language-c">/* Write a program to input three integer and find out second largest */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int a, b, c, secondLargest; + printf(&quot;Enter three number : &quot;); + scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); + if ((a &lt; b &amp;&amp; a &gt; c) || (a &gt; b &amp;&amp; a &lt; c)) + secondLargest = a; + if ((b &lt; a &amp;&amp; b &gt; c) || (b &gt; a &amp;&amp; b &lt; c)) + secondLargest = b; + if ((c &lt; b &amp;&amp; c &gt; a) || (c &gt; b &amp;&amp; c &lt; a)) + secondLargest = c; + printf(&quot;\nSecond Largest : %d&quot;, secondLargest); + 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">APC-PRAC-013.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-013.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-tuition-c-APC-PRAC-013_c', 'APC-PRAC-013.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-013_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-013.c"> + <pre><code class="language-c">/* Write a program to input sum(p), rate of interest(r), time(t) and type of interest +(&#x27;s&#x27; for simple interes, &#x27;c&#x27; for compound interest), then calculate and display the earned interest */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;ctype.h&gt; + +int main() +{ + double p, t, r, si, ci; + char mode; + printf(&quot;Enter the Principle, Time (Year) and the Rate of Interest : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;p, &amp;t, &amp;r); + printf(&quot;Enter the mode of calculation (&#x27;s&#x27; for simple interest, &#x27;c&#x27; for compound interest) : &quot;); + scanf(&quot; %c&quot;, &amp;mode); + mode = tolower(mode); + switch (mode) + { + case &#x27;s&#x27;: + si = (p * t * r) / 100; + printf(&quot;\nSimple Interest : %g&quot;, si); + return 0; + case &#x27;c&#x27;: + ci = (p * pow(1 + (r / 100), t)) - p; + printf(&quot;\nCompound Interest : %g&quot;, ci); + return 0; + default: + printf(&quot;\nYou entered a wrong choice.&quot;); + return 1; + } +}</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">APC-PRAC-014.c</span> + <div class="ml-auto flex items-center space-x-4"> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-014.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-tuition-c-APC-PRAC-014_c', 'APC-PRAC-014.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-014_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-014.c"> + <pre><code class="language-c">/* Write a program to calculate and display the maturity amount taking +the sum and number of days as input. + No. of Days Rate of Interest + =========== ================ + &lt;= 180 5.57 % + 181 - 364 7.75 % + 365 - 500 9.25 % + &gt; 500 9.15 % +*/ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. +// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues + +#include &lt;stdio.h&gt; + +int main() +{ + double p, t, r, si; + int days; + printf(&quot;Enter the Principle, Time (Days) : &quot;); + scanf(&quot;%lf %d&quot;, &amp;p, &amp;days); + if (days &gt; 0 &amp;&amp; days &lt;= 180) + r = 5.57; + else if (days &gt; 180 &amp;&amp; days &lt;= 364) + r = 7.75; + else if (days &gt; 364 &amp;&amp; days &lt;= 500) + r = 9.25; + else if (days &gt; 500) + r = 9.15; + si = (p * t * r) / 100; + printf(&quot;\nMaturity Amount : %d&quot;, si + p); + 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">APC-S-001.c</span> <div class="ml-auto flex items-center space-x-4"> <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-S-001.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/tuition-c/APC-PRAC-011.c b/tuition-c/APC-PRAC-011.c @@ -0,0 +1,27 @@ +/* Write a program to input positive number and check whether the number is +perfect square or not. If the number is negetive then display appropriate message */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include <stdio.h> +#include <math.h> + +int main() +{ + int num, temp; + printf("Enter the number : "); + scanf("%d", &num); + if (num < 0) + { + printf("\nYou entered a negetive number."); + return 1; + } + temp = (int)sqrt(num); + if (temp * temp == num) + { + printf("\nInput %d is a perfect square number.", num); + return 0; + } + else + printf("\nInput %d is not a perfect square number.", num); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-012.c b/tuition-c/APC-PRAC-012.c @@ -0,0 +1,19 @@ +/* Write a program to input three integer and find out second largest */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include <stdio.h> + +int main() +{ + int a, b, c, secondLargest; + printf("Enter three number : "); + scanf("%d %d %d", &a, &b, &c); + if ((a < b && a > c) || (a > b && a < c)) + secondLargest = a; + if ((b < a && b > c) || (b > a && b < c)) + secondLargest = b; + if ((c < b && c > a) || (c > b && c < a)) + secondLargest = c; + printf("\nSecond Largest : %d", secondLargest); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-013.c b/tuition-c/APC-PRAC-013.c @@ -0,0 +1,32 @@ +/* Write a program to input sum(p), rate of interest(r), time(t) and type of interest +('s' for simple interes, 'c' for compound interest), then calculate and display the earned interest */ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +#include <stdio.h> +#include <math.h> +#include <ctype.h> + +int main() +{ + double p, t, r, si, ci; + char mode; + printf("Enter the Principle, Time (Year) and the Rate of Interest : "); + scanf("%lf %lf %lf", &p, &t, &r); + printf("Enter the mode of calculation ('s' for simple interest, 'c' for compound interest) : "); + scanf(" %c", &mode); + mode = tolower(mode); + switch (mode) + { + case 's': + si = (p * t * r) / 100; + printf("\nSimple Interest : %g", si); + return 0; + case 'c': + ci = (p * pow(1 + (r / 100), t)) - p; + printf("\nCompound Interest : %g", ci); + return 0; + default: + printf("\nYou entered a wrong choice."); + return 1; + } +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-014.c b/tuition-c/APC-PRAC-014.c @@ -0,0 +1,35 @@ +/* Write a program to calculate and display the maturity amount taking +the sum and number of days as input. + No. of Days Rate of Interest + =========== ================ + <= 180 5.57 % + 181 - 364 7.75 % + 365 - 500 9.25 % + > 500 9.15 % +*/ +/* Author - Amit Dutta, Date - 31st October, 2025 */ + +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. +// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues + +#include <stdio.h> + +int main() +{ + double p, t, r, si; + int days; + printf("Enter the Principle, Time (Days) : "); + scanf("%lf %d", &p, &days); + if (days > 0 && days <= 180) + r = 5.57; + else if (days > 180 && days <= 364) + r = 7.75; + else if (days > 364 && days <= 500) + r = 9.25; + else if (days > 500) + r = 9.15; + si = (p * t * r) / 100; + printf("\nMaturity Amount : %d", si + p); + 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