commit f7005c3a47b3fbec248fbe933b47aafb5f80b71d
parent 44b9528e0a64c427b0e16d592f0b545c05575dd1
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sat, 18 Oct 2025 20:41:32 +0530
_tuition-33-37, _docs-i
Diffstat:
6 files changed, 307 insertions(+), 1 deletion(-)
diff --git a/docs/index.html b/docs/index.html
@@ -2789,7 +2789,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">(53 files)</span>
+ <span class="ml-2 text-sm text-gray-500">(58 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">
@@ -4693,6 +4693,194 @@ int main()
}</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">P033.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P033.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-P033_c', 'P033.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-tuition-c-P033_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P033.c">
+ <pre><code class="language-c">/* WAP to calculate the sum of even digits and odd digits. Number will be provided by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, odd = 0, even = 0, temp;
+ printf("Enter the number : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ }
+ printf("\nSum of even : %d"
+ "\nSum of odd : %d",
+ even, odd);
+ 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">P034.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P034.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-P034_c', 'P034.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-tuition-c-P034_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P034.c">
+ <pre><code class="language-c">/* Get sum of even position digit and odd position digit */
+/* Counting starts from the rightmost digit as position 1 (Odd). */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, temp, index = 1, even = 0, odd = 0;
+ printf("Enter the numebr : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if (index % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ index++;
+ }
+ printf("\nSum of even position digits : %d"
+ "\nSum of odd position digits : %d",
+ even, odd);
+ 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">P035.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P035.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-P035_c', 'P035.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-tuition-c-P035_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P035.c">
+ <pre><code class="language-c">/* WAP to input an int number and display the product of the successors
+of even digits of the number entered by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <stdbool.h>
+int main()
+{
+ int n, res = 1, temp;
+ bool status = false;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ temp = n;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ {
+ res *= (temp % 10) + 1;
+ status = true;
+ }
+ temp /= 10;
+ }
+ if (!status)
+ printf("\nThere is no even digits.");
+ else
+ printf("\nThe product of the successors of even digits of the number %d is : %d", n, res);
+ 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">P036.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P036.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-P036_c', 'P036.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-tuition-c-P036_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P036.c">
+ <pre><code class="language-c">/* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ double a, sum = 0;
+ int n, i;
+ printf("Enter value for a and n : ");
+ scanf("%lf %d", &a, &n);
+ for (i = 1; i <= n; i++)
+ sum += pow(a, i) / i;
+ printf("\nSum = %g", sum);
+ 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">P037.c</span>
+ <div class="ml-auto flex items-center space-x-4">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P037.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-P037_c', 'P037.c')" class="text-green-600 font-semibold text-sm hover:underline">View Code</button>
+ </div>
+ </div>
+ <div id="code-tuition-c-P037_c" class="hidden" data-github-url="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P037.c">
+ <pre><code class="language-c">/* sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ double sum = 0, temp1 = 0, temp2 = 1;
+ int n, i;
+ printf("Enter value for n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ temp1 += i;
+ temp2 *= i;
+ sum += temp1 / temp2;
+ }
+ printf("\nSum = %g", sum);
+ return 0;
+}</code></pre>
+ </div>
+ </li>
</ul>
</div>
</li>
diff --git a/tuition-c/P033.c b/tuition-c/P033.c
@@ -0,0 +1,23 @@
+/* WAP to calculate the sum of even digits and odd digits. Number will be provided by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, odd = 0, even = 0, temp;
+ printf("Enter the number : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ }
+ printf("\nSum of even : %d"
+ "\nSum of odd : %d",
+ even, odd);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P034.c b/tuition-c/P034.c
@@ -0,0 +1,25 @@
+/* Get sum of even position digit and odd position digit */
+/* Counting starts from the rightmost digit as position 1 (Odd). */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, temp, index = 1, even = 0, odd = 0;
+ printf("Enter the numebr : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if (index % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ index++;
+ }
+ printf("\nSum of even position digits : %d"
+ "\nSum of odd position digits : %d",
+ even, odd);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P035.c b/tuition-c/P035.c
@@ -0,0 +1,28 @@
+/* WAP to input an int number and display the product of the successors
+of even digits of the number entered by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <stdbool.h>
+int main()
+{
+ int n, res = 1, temp;
+ bool status = false;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ temp = n;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ {
+ res *= (temp % 10) + 1;
+ status = true;
+ }
+ temp /= 10;
+ }
+ if (!status)
+ printf("\nThere is no even digits.");
+ else
+ printf("\nThe product of the successors of even digits of the number %d is : %d", n, res);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P036.c b/tuition-c/P036.c
@@ -0,0 +1,17 @@
+/* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ double a, sum = 0;
+ int n, i;
+ printf("Enter value for a and n : ");
+ scanf("%lf %d", &a, &n);
+ for (i = 1; i <= n; i++)
+ sum += pow(a, i) / i;
+ printf("\nSum = %g", sum);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P037.c b/tuition-c/P037.c
@@ -0,0 +1,20 @@
+/* sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ double sum = 0, temp1 = 0, temp2 = 1;
+ int n, i;
+ printf("Enter value for n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ temp1 += i;
+ temp2 *= i;
+ sum += temp1 / temp2;
+ }
+ printf("\nSum = %g", sum);
+ return 0;
+}+
\ No newline at end of file