bsc

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

commit 147613b77429838d663144fa7efb2161419b9238
parent d2a9594746aab15018ba7dbf280d017f4554a40b
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Fri,  7 Nov 2025 21:59:24 +0530

new -07112025 APC-PRAC-019 to APC-PRAC-023

Diffstat:
Mdocs/index.html | 256++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Atuition-c/APC-PRAC-019.c | 26++++++++++++++++++++++++++
Atuition-c/APC-PRAC-020.c | 29+++++++++++++++++++++++++++++
Atuition-c/APC-PRAC-021.c | 30++++++++++++++++++++++++++++++
Atuition-c/APC-PRAC-022.c | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atuition-c/APC-PRAC-023.c | 44++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 439 insertions(+), 1 deletion(-)

diff --git a/docs/index.html b/docs/index.html @@ -4349,7 +4349,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">(82 files)</span> + <span class="ml-2 text-sm text-gray-500">(87 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"> @@ -5042,6 +5042,260 @@ 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-019.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-019.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-019_c', 'APC-PRAC-019.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-019_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-019.c"> + <pre><code class="language-c">/* Write a program to find hcf of two numbers */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202501.c (LAB), APC-PRAC-019.c (Local) + +// 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() +{ + int a, b, temp, temp_a, temp_b; + printf(&quot;Enter the a and b : &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + temp_a = a, temp_b = b; + while (b &gt; 0) + { + temp = a; + a = b; + b = temp % b; + } + printf(&quot;\nHCF of %d and %d is : %d\n&quot;, temp_a, temp_b, a); + 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-020.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-020.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-020_c', 'APC-PRAC-020.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-020_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-020.c"> + <pre><code class="language-c">/* Write a program to check if two number is co-prime or not */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202502.c (LAB), APC-PRAC-020.c (Local) + +// 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() +{ + int a, b, temp, temp_a, temp_b; + printf(&quot;Enter the a and b : &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + temp_a = a, temp_b = b; + while (b &gt; 0) + { + temp = a; + a = b; + b = temp % b; + } + if (a == 1) + printf(&quot;\n%d and %d is co-prime\n&quot;, temp_a, temp_b); + else + printf(&quot;\n%d and %d is NOT co-prime\n&quot;, temp_a, temp_b); + 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-021.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-021.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-021_c', 'APC-PRAC-021.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-021_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-021.c"> + <pre><code class="language-c">/* Write a program to check special number (sum of digit + product of digit = original number) */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202503.c (LAB), APC-PRAC-021.c (Local) + +// 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() +{ + int num, temp, sumOfDigit = 0, productOfDigit = 1; + printf(&quot;Enter the number to check if it is a special number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + temp = num; + while (temp &gt; 0) + { + sumOfDigit += temp % 10; + productOfDigit *= temp % 10; + temp /= 10; + } + temp = sumOfDigit + productOfDigit; + if (num == temp) + printf(&quot;\nInput %d is a special number.&quot;, num); + else + printf(&quot;\nInput %d is not a special 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-022.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-022.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-022_c', 'APC-PRAC-022.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-022_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-022.c"> + <pre><code class="language-c">/* Write a program to accept a number and check whether the number is twisted prime or not */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202504.c (LAB), APC-PRAC-022.c (Local) + +// 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; +#include &lt;math.h&gt; +#include &lt;stdbool.h&gt; + +bool checkPrime(int num) +{ + if (num &lt; 2) + return false; + if (num == 2) + return true; + if (num % 2 == 0) + return false; + int limit = (int)sqrt(num); + for (int i = 3; i &lt;= limit; i += 2) + if (num % i == 0) + return false; + return true; +} + +int reverseNumber(int num) +{ + int reverse = 0; + while (num &gt; 0) + { + reverse = (reverse * 10) + (num % 10); + num /= 10; + } + return reverse; +} + +int main() +{ + int num; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (!checkPrime(num)) + { + printf(&quot;\nInput %d is not a prime number.&quot;, num); + return 0; + } + if (checkPrime(reverseNumber(num))) + printf(&quot;\nInput %d is a twisted prime number.&quot;, num); + else + printf(&quot;\nInput %d is not a twisted prime 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-023.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-023.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-023_c', 'APC-PRAC-023.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button> + </div> + </div> + <div id="code-tuition-c-APC-PRAC-023_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/APC-PRAC-023.c"> + <pre><code class="language-c">/* Pattern : + (a) 1, -3, 5, -7, 9, -11, ... upto n times + (b) 0, 3, 8, 15, ... upto n times +*/ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202505.c (LAB), APC-PRAC-023.c (Local) + +// 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; +#include &lt;stdbool.h&gt; + +int main() +{ + int n, i, temp = 1; + bool isNegative = true; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + printf(&quot;\nPattern A :&quot;); + for (i = 1; i &lt;= n; i++) + { + if (!isNegative) + { + printf(&quot; %d&quot;, temp * -1); + isNegative = true; + } + else + { + printf(&quot; %d&quot;, temp); + isNegative = false; + } + temp += 2; + } + printf(&quot;\nPattern B :&quot;); + for (i = 1; i &lt;= n; i++) + { + temp = (i * i) - 1; + printf(&quot; %d&quot;, temp); + } + 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-019.c b/tuition-c/APC-PRAC-019.c @@ -0,0 +1,25 @@ +/* Write a program to find hcf of two numbers */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202501.c (LAB), APC-PRAC-019.c (Local) + +// 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() +{ + int a, b, temp, temp_a, temp_b; + printf("Enter the a and b : "); + scanf("%d %d", &a, &b); + temp_a = a, temp_b = b; + while (b > 0) + { + temp = a; + a = b; + b = temp % b; + } + printf("\nHCF of %d and %d is : %d\n", temp_a, temp_b, a); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-020.c b/tuition-c/APC-PRAC-020.c @@ -0,0 +1,28 @@ +/* Write a program to check if two number is co-prime or not */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202502.c (LAB), APC-PRAC-020.c (Local) + +// 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() +{ + int a, b, temp, temp_a, temp_b; + printf("Enter the a and b : "); + scanf("%d %d", &a, &b); + temp_a = a, temp_b = b; + while (b > 0) + { + temp = a; + a = b; + b = temp % b; + } + if (a == 1) + printf("\n%d and %d is co-prime\n", temp_a, temp_b); + else + printf("\n%d and %d is NOT co-prime\n", temp_a, temp_b); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-021.c b/tuition-c/APC-PRAC-021.c @@ -0,0 +1,29 @@ +/* Write a program to check special number (sum of digit + product of digit = original number) */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202503.c (LAB), APC-PRAC-021.c (Local) + +// 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() +{ + int num, temp, sumOfDigit = 0, productOfDigit = 1; + printf("Enter the number to check if it is a special number : "); + scanf("%d", &num); + temp = num; + while (temp > 0) + { + sumOfDigit += temp % 10; + productOfDigit *= temp % 10; + temp /= 10; + } + temp = sumOfDigit + productOfDigit; + if (num == temp) + printf("\nInput %d is a special number.", num); + else + printf("\nInput %d is not a special number.", num); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-022.c b/tuition-c/APC-PRAC-022.c @@ -0,0 +1,54 @@ +/* Write a program to accept a number and check whether the number is twisted prime or not */ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202504.c (LAB), APC-PRAC-022.c (Local) + +// 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> +#include <math.h> +#include <stdbool.h> + +bool checkPrime(int num) +{ + if (num < 2) + return false; + if (num == 2) + return true; + if (num % 2 == 0) + return false; + int limit = (int)sqrt(num); + for (int i = 3; i <= limit; i += 2) + if (num % i == 0) + return false; + return true; +} + +int reverseNumber(int num) +{ + int reverse = 0; + while (num > 0) + { + reverse = (reverse * 10) + (num % 10); + num /= 10; + } + return reverse; +} + +int main() +{ + int num; + printf("Enter the number : "); + scanf("%d", &num); + if (!checkPrime(num)) + { + printf("\nInput %d is not a prime number.", num); + return 0; + } + if (checkPrime(reverseNumber(num))) + printf("\nInput %d is a twisted prime number.", num); + else + printf("\nInput %d is not a twisted prime number.", num); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/APC-PRAC-023.c b/tuition-c/APC-PRAC-023.c @@ -0,0 +1,43 @@ +/* Pattern : + (a) 1, -3, 5, -7, 9, -11, ... upto n times + (b) 0, 3, 8, 15, ... upto n times +*/ +/* Author - Amit Dutta, Date - 07th November, 2025 */ +// File Name - amit0711202505.c (LAB), APC-PRAC-023.c (Local) + +// 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> +#include <stdbool.h> + +int main() +{ + int n, i, temp = 1; + bool isNegative = true; + printf("Enter the n : "); + scanf("%d", &n); + printf("\nPattern A :"); + for (i = 1; i <= n; i++) + { + if (!isNegative) + { + printf(" %d", temp * -1); + isNegative = true; + } + else + { + printf(" %d", temp); + isNegative = false; + } + temp += 2; + } + printf("\nPattern B :"); + for (i = 1; i <= n; i++) + { + temp = (i * i) - 1; + printf(" %d", temp); + } + 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