bsc

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

commit 0f1e8af5da8eb962a9f624bd64c1cb135aa7b72d
parent 41362082ede1e4dbf32f5ff14ce8bb8b42938958
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Sat, 11 Oct 2025 21:01:17 +0530

index update

Diffstat:
Mdocs/index.html | 52++++++++++++++++++++++++++++++++++++++++++----------
Dletusc/luc034.c | 0
Atuition-c/P028.c | 32++++++++++++++++++++++++++++++++
Atuition-c/P029.c | 27+++++++++++++++++++++++++++
Atuition-c/P030.c | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atuition-c/P031.c | 42++++++++++++++++++++++++++++++++++++++++++
Atuition-c/P032.c | 23+++++++++++++++++++++++
7 files changed, 225 insertions(+), 10 deletions(-)

diff --git a/docs/index.html b/docs/index.html @@ -109,7 +109,7 @@ <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">(43 files)</span> + <span class="ml-2 text-sm text-gray-500">(42 files)</span> </div> <div class="flex items-center space-x-2"> <a href="https://github.com/notamitgamer/bsc/tree/main/letusc" target="_blank" class="text-blue-500 font-semibold text-sm hover:underline" onclick="event.stopPropagation()">GitHub</a> @@ -401,14 +401,6 @@ </li> <li> - <a href="https://github.com/notamitgamer/bsc/blob/main/letusc/luc034.c" target="_blank" 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">luc034.c</span> - <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> - </a> - </li> - - <li> <a href="https://github.com/notamitgamer/bsc/blob/main/letusc/lucproblem001.c" target="_blank" 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> @@ -473,7 +465,7 @@ <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">(49 files)</span> + <span class="ml-2 text-sm text-gray-500">(54 files)</span> </div> <div class="flex items-center space-x-2"> <a href="https://github.com/notamitgamer/bsc/tree/main/tuition-c" target="_blank" class="text-blue-500 font-semibold text-sm hover:underline" onclick="event.stopPropagation()">GitHub</a> @@ -869,6 +861,46 @@ </li> <li> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P028.c" target="_blank" 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">P028.c</span> + <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> + </a> + </li> + + <li> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P029.c" target="_blank" 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">P029.c</span> + <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> + </a> + </li> + + <li> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P030.c" target="_blank" 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">P030.c</span> + <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> + </a> + </li> + + <li> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P031.c" target="_blank" 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">P031.c</span> + <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> + </a> + </li> + + <li> + <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/P032.c" target="_blank" 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">P032.c</span> + <span class="ml-auto text-green-500 text-sm">View Code &rarr;</span> + </a> + </li> + + <li> <a href="https://github.com/notamitgamer/bsc/blob/main/tuition-c/README.md" target="_blank" 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">README.md</span> diff --git a/letusc/luc034.c b/letusc/luc034.c diff --git a/tuition-c/P028.c b/tuition-c/P028.c @@ -0,0 +1,31 @@ +/* WAP to calculate factorial of a number */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include <stdio.h> +int main() +{ + int i = 1, num, fact = 1; + printf("Enter the number : "); + if (scanf("%d", &num) != 1) + { + printf("\nPlease enter a number."); + return 1; + } + if (num == 0) + { + printf("\nFactorial of 0 : 1"); + return 0; + } + if (num < 0) + { + printf("\nFactorial of %d : UNDEFINED", num); + return 0; + } + while (i <= num) + { + fact = fact * i; + i++; + } + printf("Factorial of %d : %d", num, fact); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/P029.c b/tuition-c/P029.c @@ -0,0 +1,26 @@ +/* WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ... */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include <stdio.h> +int main() +{ + int num, i = 0, result = 0; + printf("Enter the value for n : "); + if (scanf("%d", &num) != 1) + { + printf("\nPlease enter a number."); + return 1; + } + if (num < 1) + { + printf("\nPlease enter a positive number."); + return 1; + } + while (i <= num) + { + result = result + i; + i++; + } + printf("\nResult : %d", result); + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/P030.c b/tuition-c/P030.c @@ -0,0 +1,59 @@ +/* Display the first 15 terms of the series. */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include <stdio.h> +#include <math.h> + +int main() +{ + int i, r; + + // 3, 6, 9, 12, ... + { + i = 3, r = 0; + printf("Series 1 (3, 6, 9, 12, ...) :"); + while (i <= 15) + { + r = r + 3; + printf(" %d", r); + i++; + } + } + + // 1, 4, 9, 16, ... + { + i = 1; + printf("\nSeries 2 (1, 4, 9, 16, ...) :"); + while (i <= 15) + { + printf(" %d", i * i); + i++; + } + } + + // 4, 8, 16, 32, ... + { + i = 1, r = 2; + printf("\nSeries 3 (4, 8, 16, 32, ...) :"); + while (i <= 15) + { + r = r * 2; + printf(" %d", r); + i++; + } + } + + // 0, 7, 26, ... + { + i = 1, r; + printf("\nSeries 4 (0, 7, 26, ...) :"); + while (i <= 15) + { + r = (int)pow(i, 3) - 1; + printf(" %d", r); + i++; + } + } + + return 0; +} diff --git a/tuition-c/P031.c b/tuition-c/P031.c @@ -0,0 +1,41 @@ +/* Find the sum of the series */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include <stdio.h> +#include <math.h> + +int main() +{ + double a, res, n; + int i; + + // s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10) + { + res = 0, i = 1; + printf("--- s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10) ---"); + printf("\nEnter the number : "); + scanf("%lf", &a); + while (i <= 10) + { + res = res + ((a * a) / i); + i++; + } + printf("S = %g", res); + } + + // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n + { + res = 0, i = 0; + printf("\n--- // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n ---"); + printf("\nEnter the value for a and n : "); + scanf(" %lf %lf", &a, &n); + while (i <= n - 1) + { + res = res + (pow(i + 1, i + 1) / pow(a, i)); + i++; + } + printf("S = %g", res); + } + + return 0; +}+ \ No newline at end of file diff --git a/tuition-c/P032.c b/tuition-c/P032.c @@ -0,0 +1,22 @@ +/* WAP to input a number and check whether it is a Niven number +or not. (When a number is divisible by its sum of digit) e.g. : n = 126*/ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include <stdio.h> +int main() +{ + int n, temp, sod = 0; + printf("Enter the number : "); + scanf("%d", &n); + temp = n; + while (temp > 0) + { + sod = sod + (temp % 10); + temp = temp / 10; + } + if (n % sod == 0) + printf("\nIt is Niven number."); + else + printf("\nIt is not a Niven number."); + 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