bsc

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

commit 52d48c131701ee0774d9d91c786ed16cadb4e2e2
parent 214b96835244a0c374796547b8c689051a3e076c
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Mon, 26 Jan 2026 14:54:48 +0530

[2026-01-26] : .\Semester_1 : Chnaged License from ESAL-1.0 to MIT

Diffstat:
MSemester_1/assignment-primary/assignment-p-01.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-02.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-03.c | 14+++-----------
MSemester_1/assignment-primary/assignment-p-04.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-05.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-06.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-07.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-08.c | 14+++-----------
MSemester_1/assignment-primary/assignment-p-09.c | 14+++-----------
MSemester_1/assignment-primary/assignment-p-10.c | 14+++-----------
MSemester_1/assignment-primary/assignment-p-11.c | 16+++++-----------
DSemester_1/assignment-primary/assignment-p-11.exe | 0
MSemester_1/assignment-primary/assignment-p-12.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-13.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-14.c | 16+++++-----------
MSemester_1/assignment-primary/assignment-p-15.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-01.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-02.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-03.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-04.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-05.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-06.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-07.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-08.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-09.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-10.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-11.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-12.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-13-1.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-13-2.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-14.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-15.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-16.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-17.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-18.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-19.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-20.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-21.c | 16+++++-----------
MSemester_1/assignment-secondary/assignment-s-22.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-23.c | 14+++-----------
MSemester_1/assignment-secondary/assignment-s-24.c | 14+++-----------
MSemester_1/challenge/sudipto1.c | 16+++++-----------
MSemester_1/internal-practice/IP-01.c | 14+++-----------
MSemester_1/internal-practice/IP-02.c | 14+++-----------
MSemester_1/internal-practice/IP-03.c | 14+++-----------
MSemester_1/internal-practice/IP-04.c | 16+++++-----------
MSemester_1/internal-practice/IP-05.c | 16+++++-----------
MSemester_1/internal-practice/IP-06.c | 14+++-----------
MSemester_1/internal-practice/IP-07.c | 14+++-----------
MSemester_1/internal-practice/IP-08.c | 14+++-----------
MSemester_1/internal-practice/IP-09.c | 14+++-----------
MSemester_1/internal-practice/IP-10.c | 16+++++-----------
MSemester_1/internal-practice/IP-11.c | 16+++++-----------
MSemester_1/internal-practice/IP-12.c | 16+++++-----------
MSemester_1/internal-practice/IP-13.c | 16+++++-----------
MSemester_1/internal-practice/IP-14.c | 16+++++-----------
MSemester_1/internal-practice/IP-15.c | 16+++++-----------
MSemester_1/internal-practice/IP-16.c | 16+++++-----------
MSemester_1/internal-practice/IP-17.c | 14+++-----------
MSemester_1/internal-practice/IP-18.c | 16+++++-----------
MSemester_1/internal-practice/IP-19.c | 16+++++-----------
MSemester_1/internal-practice/IP-20.c | 16+++++-----------
MSemester_1/khurapati-idea/KI001.c | 14+++-----------
MSemester_1/khurapati-idea/KI002.c | 14+++-----------
MSemester_1/khurapati-idea/KI003.c | 16+++++-----------
MSemester_1/letusc/luc001.c | 14+++-----------
MSemester_1/letusc/luc002.c | 14+++-----------
MSemester_1/letusc/luc003.c | 14+++-----------
MSemester_1/letusc/luc004.c | 14+++-----------
MSemester_1/letusc/luc005.c | 14+++-----------
MSemester_1/letusc/luc006.c | 14+++-----------
MSemester_1/letusc/luc007.c | 14+++-----------
MSemester_1/letusc/luc008.c | 14+++-----------
MSemester_1/letusc/luc009.c | 14+++-----------
MSemester_1/letusc/luc010.c | 14+++-----------
MSemester_1/letusc/luc011.c | 14+++-----------
MSemester_1/letusc/luc012.c | 14+++-----------
MSemester_1/letusc/luc013.c | 14+++-----------
MSemester_1/letusc/luc014.c | 14+++-----------
MSemester_1/letusc/luc015.c | 14+++-----------
MSemester_1/letusc/luc016.c | 16+++++-----------
MSemester_1/letusc/luc017.c | 14+++-----------
MSemester_1/letusc/luc018-logic.c | 16+++++-----------
MSemester_1/letusc/luc018.c | 14+++-----------
MSemester_1/letusc/luc019.c | 16+++++-----------
MSemester_1/letusc/luc020.c | 16+++++-----------
MSemester_1/letusc/luc021.c | 16+++++-----------
MSemester_1/letusc/luc022.c | 16+++++-----------
MSemester_1/letusc/luc023.c | 14+++-----------
MSemester_1/letusc/luc024.c | 14+++-----------
MSemester_1/letusc/luc025.c | 14+++-----------
MSemester_1/letusc/luc026.c | 14+++-----------
MSemester_1/letusc/luc027.c | 14+++-----------
MSemester_1/letusc/luc028.c | 14+++-----------
MSemester_1/letusc/luc029.c | 14+++-----------
MSemester_1/letusc/luc030.c | 16+++++-----------
MSemester_1/letusc/luc031-logic.c | 16+++++-----------
MSemester_1/letusc/luc031.c | 14+++-----------
MSemester_1/letusc/luc032.c | 14+++-----------
MSemester_1/letusc/luc033.c | 14+++-----------
MSemester_1/letusc/luc034.c | 14+++-----------
MSemester_1/letusc/luc035.c | 14+++-----------
MSemester_1/letusc/luc036.c | 14+++-----------
MSemester_1/letusc/luc037.c | 14+++-----------
MSemester_1/letusc/luc038.c | 14+++-----------
MSemester_1/letusc/luc039.c | 14+++-----------
MSemester_1/letusc/luc040-logic.c | 16+++++-----------
MSemester_1/letusc/luc040.c | 16+++++-----------
MSemester_1/letusc/luc041.c | 14+++-----------
MSemester_1/letusc/luc042.c | 14+++-----------
MSemester_1/letusc/luc043.c | 16+++++-----------
MSemester_1/letusc/luc044.c | 14+++-----------
MSemester_1/letusc/luc045.c | 16+++++-----------
MSemester_1/letusc/luc046.c | 14+++-----------
MSemester_1/letusc/luc047.c | 14+++-----------
MSemester_1/letusc/luc048.c | 16+++++-----------
MSemester_1/letusc/lucproblem001.c | 14+++-----------
MSemester_1/letusc/lucproblem002.c | 14+++-----------
MSemester_1/letusc/lucproblem003.c | 14+++-----------
MSemester_1/letusc/lucproblem004.c | 14+++-----------
MSemester_1/letusc/lucproblem005.c | 14+++-----------
MSemester_1/letusc/lucproblem006.c | 14+++-----------
MSemester_1/letusc/lucproblem007.c | 14+++-----------
MSemester_1/letusc/lucproblem008.c | 14+++-----------
MSemester_1/letusc/lucproblem009.c | 14+++-----------
MSemester_1/letusc/lucproblem010-complex.c | 16+++++-----------
MSemester_1/letusc/lucproblem010.c | 16+++++-----------
MSemester_1/letusc/lucproblem011.c | 16+++++-----------
MSemester_1/letusc/lucproblem012.c | 14+++-----------
MSemester_1/letusc/lucproblem013.c | 14+++-----------
MSemester_1/letusc/lucproblem014-short.c | 16+++++-----------
MSemester_1/letusc/lucproblem014.c | 16+++++-----------
MSemester_1/letusc/lucproblem015.c | 16+++++-----------
MSemester_1/letusc/lucproblem016.c | 14+++-----------
MSemester_1/practice-c/pc-ip-01.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-02.c | 14+++-----------
MSemester_1/practice-c/pc-ip-03.c | 14+++-----------
MSemester_1/practice-c/pc-ip-04.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-05.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-06.c | 14+++-----------
MSemester_1/practice-c/pc-ip-07.c | 14+++-----------
MSemester_1/practice-c/pc-ip-08.c | 14+++-----------
MSemester_1/practice-c/pc-ip-09.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-10.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-11.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-12.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-13.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-14.c | 14+++-----------
MSemester_1/practice-c/pc-ip-15.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-16.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-17.c | 14+++-----------
MSemester_1/practice-c/pc-ip-18.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-19.c | 16+++++-----------
MSemester_1/practice-c/pc-ip-20.c | 16+++++-----------
MSemester_1/practice-c/pc001.c | 14+++-----------
MSemester_1/practice-c/pc002.c | 14+++-----------
MSemester_1/practice-c/pc003.c | 14+++-----------
MSemester_1/practice-c/pc004.c | 14+++-----------
MSemester_1/practice-c/pc005.c | 14+++-----------
MSemester_1/practice-c/pc006.c | 16+++++-----------
MSemester_1/practice-c/pc007.c | 14+++-----------
MSemester_1/practice-c/pc008.c | 14+++-----------
MSemester_1/practice-c/pc009.c | 14+++-----------
MSemester_1/practice-c/pc010.c | 14+++-----------
MSemester_1/practice-c/pc011.c | 16+++++-----------
MSemester_1/practice-c/pc012.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-001.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-002.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-003.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-004.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-005.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-006.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-007.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-008.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-009.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-010.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-011.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-012.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-013.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-014.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-015.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-016.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-017.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-018.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-019.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-020.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-021.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-022.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-023.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-024.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-025.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-026.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-027.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-028.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-029.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-030.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-031.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-032.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-033.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-034.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-035.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-036.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-037.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-038.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-039.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-040.c | 14+++-----------
MSemester_1/tuition-c/APC-PRAC-041.c | 16+++++-----------
MSemester_1/tuition-c/APC-PRAC-042.c | 16+++++-----------
MSemester_1/tuition-c/APC-S-001.c | 14+++-----------
MSemester_1/tuition-c/APC-S-002.c | 14+++-----------
MSemester_1/tuition-c/APC-S-003.c | 14+++-----------
MSemester_1/tuition-c/APC-S-004.c | 14+++-----------
MSemester_1/tuition-c/APC-S-005.c | 14+++-----------
MSemester_1/tuition-c/APC-S-006.c | 14+++-----------
MSemester_1/tuition-c/APC-S-007.c | 14+++-----------
MSemester_1/tuition-c/APC-S-008.c | 16+++++-----------
MSemester_1/tuition-c/APC-S-009.c | 16+++++-----------
MSemester_1/tuition-c/APC-S-010.c | 14+++-----------
MSemester_1/tuition-c/APC-S-011.c | 14+++-----------
MSemester_1/tuition-c/APC-S-012.c | 14+++-----------
MSemester_1/tuition-c/APC-S-013.c | 14+++-----------
MSemester_1/tuition-c/APC-S-014.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-001.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-002.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-003.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-004.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-005.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-006.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-007.c | 14+++-----------
MSemester_1/tuition-c/APC-SPS-008.c | 14+++-----------
MSemester_1/tuition-c/P001.c | 14+++-----------
MSemester_1/tuition-c/P002.c | 14+++-----------
MSemester_1/tuition-c/P003.c | 14+++-----------
MSemester_1/tuition-c/P004.c | 14+++-----------
MSemester_1/tuition-c/P005.c | 14+++-----------
MSemester_1/tuition-c/P006.c | 14+++-----------
MSemester_1/tuition-c/P007.c | 14+++-----------
MSemester_1/tuition-c/P008.c | 14+++-----------
MSemester_1/tuition-c/P009.c | 14+++-----------
MSemester_1/tuition-c/P010.c | 14+++-----------
MSemester_1/tuition-c/P011.c | 14+++-----------
MSemester_1/tuition-c/P012.c | 14+++-----------
MSemester_1/tuition-c/P013.c | 14+++-----------
MSemester_1/tuition-c/P014.c | 14+++-----------
MSemester_1/tuition-c/P015.c | 14+++-----------
MSemester_1/tuition-c/P016.c | 14+++-----------
MSemester_1/tuition-c/P017.c | 14+++-----------
MSemester_1/tuition-c/P018.c | 14+++-----------
MSemester_1/tuition-c/P019.c | 14+++-----------
MSemester_1/tuition-c/P020.c | 14+++-----------
MSemester_1/tuition-c/P021.c | 14+++-----------
MSemester_1/tuition-c/P022.c | 14+++-----------
MSemester_1/tuition-c/P023.c | 14+++-----------
MSemester_1/tuition-c/P024.c | 14+++-----------
MSemester_1/tuition-c/P025.c | 14+++-----------
MSemester_1/tuition-c/P026.c | 14+++-----------
MSemester_1/tuition-c/P027.c | 16+++++-----------
MSemester_1/tuition-c/P028.c | 14+++-----------
MSemester_1/tuition-c/P029.c | 14+++-----------
MSemester_1/tuition-c/P030.c | 16+++++-----------
MSemester_1/tuition-c/P031.c | 14+++-----------
MSemester_1/tuition-c/P032.c | 14+++-----------
MSemester_1/tuition-c/P033.c | 14+++-----------
MSemester_1/tuition-c/P034.c | 14+++-----------
MSemester_1/tuition-c/P035.c | 14+++-----------
MSemester_1/tuition-c/P036.c | 14+++-----------
MSemester_1/tuition-c/P037.c | 14+++-----------
MSemester_1/tuition-c/P038.c | 16+++++-----------
MSemester_1/tuition-c/P039.c | 14+++-----------
MSemester_1/tuition-c/P040.c | 14+++-----------
MSemester_1/tuition-c/P041.c | 14+++-----------
MSemester_1/tuition-c/P042.c | 16+++++-----------
MSemester_1/tuition-c/P043.c | 14+++-----------
MSemester_1/tuition-c/P044.c | 16+++++-----------
MSemester_1/tuition-c/P045.c | 14+++-----------
MSemester_1/tuition-c/P046.c | 14+++-----------
MSemester_1/tuition-c/P047.c | 14+++-----------
MSemester_1/tuition-c/P048.c | 14+++-----------
MSemester_1/tuition-c/P049.c | 14+++-----------
MSemester_1/tuition-c/P050-SHORT.c | 14+++-----------
MSemester_1/tuition-c/P050.c | 14+++-----------
MSemester_1/tuition-c/P051.c | 14+++-----------
MSemester_1/tuition-c/P052.c | 14+++-----------
MSemester_1/tuition-c/P053.c | 16+++++-----------
MSemester_1/tuition-c/P054.c | 16+++++-----------
MSemester_1/tuition-c/P055.c | 14+++-----------
MSemester_1/tuition-c/P056.c | 14+++-----------
MSemester_1/tuition-c/P057.c | 14+++-----------
MSemester_1/tuition-c/P058.c | 14+++-----------
MSemester_1/tuition-c/P059.c | 16+++++-----------
MSemester_1/tuition-c/P060.c | 16+++++-----------
MSemester_1/tuition-c/P061.c | 14+++-----------
MSemester_1/tuition-c/P062.c | 16+++++-----------
MSemester_1/tuition-c/P063.c | 16+++++-----------
MSemester_1/tuition-c/P064.c | 16+++++-----------
MSemester_1/tuition-c/P065.c | 14+++-----------
MSemester_1/tuition-c/P066.c | 14+++-----------
MSemester_1/tuition-c/P067.c | 14+++-----------
MSemester_1/tuition-c/P068.c | 14+++-----------
MSemester_1/tuition-c/P069.c | 16+++++-----------
MSemester_1/tuition-c/P070.c | 16+++++-----------
Mdocs/index.html | 39408+++++++++++++++++++++++++++++++++++++------------------------------------------
302 files changed, 19383 insertions(+), 24413 deletions(-)

diff --git a/Semester_1/assignment-primary/assignment-p-01.c b/Semester_1/assignment-primary/assignment-p-01.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named isPrime with the signature diff --git a/Semester_1/assignment-primary/assignment-p-02.c b/Semester_1/assignment-primary/assignment-p-02.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named isArmstrong with the diff --git a/Semester_1/assignment-primary/assignment-p-03.c b/Semester_1/assignment-primary/assignment-p-03.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named isPerfect with the signature diff --git a/Semester_1/assignment-primary/assignment-p-04.c b/Semester_1/assignment-primary/assignment-p-04.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that takes an integer input representing a month (1 to 12) and a year. diff --git a/Semester_1/assignment-primary/assignment-p-05.c b/Semester_1/assignment-primary/assignment-p-05.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that defines an array of integers, and includes a user-defined function diff --git a/Semester_1/assignment-primary/assignment-p-06.c b/Semester_1/assignment-primary/assignment-p-06.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named findLargest with the diff --git a/Semester_1/assignment-primary/assignment-p-07.c b/Semester_1/assignment-primary/assignment-p-07.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named binarySearch with the diff --git a/Semester_1/assignment-primary/assignment-p-08.c b/Semester_1/assignment-primary/assignment-p-08.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named countSetBits with the diff --git a/Semester_1/assignment-primary/assignment-p-09.c b/Semester_1/assignment-primary/assignment-p-09.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a C program that includes a user-defined function named setBit with the signature diff --git a/Semester_1/assignment-primary/assignment-p-10.c b/Semester_1/assignment-primary/assignment-p-10.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a C program that defines a structure Rectangle with attributes length and width. diff --git a/Semester_1/assignment-primary/assignment-p-11.c b/Semester_1/assignment-primary/assignment-p-11.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that defines a structure Student containing the attributes rollNumber, diff --git a/Semester_1/assignment-primary/assignment-p-11.exe b/Semester_1/assignment-primary/assignment-p-11.exe Binary files differ. diff --git a/Semester_1/assignment-primary/assignment-p-12.c b/Semester_1/assignment-primary/assignment-p-12.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that takes multiple integers as command-line arguments and finds the diff --git a/Semester_1/assignment-primary/assignment-p-13.c b/Semester_1/assignment-primary/assignment-p-13.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that accepts a string as a command line argument and includes a user- diff --git a/Semester_1/assignment-primary/assignment-p-14.c b/Semester_1/assignment-primary/assignment-p-14.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that opens its own source code file, reads its contents, and then prints diff --git a/Semester_1/assignment-primary/assignment-p-15.c b/Semester_1/assignment-primary/assignment-p-15.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that reads a sequence of integers from a file named 'input.txt'. This diff --git a/Semester_1/assignment-secondary/assignment-s-01.c b/Semester_1/assignment-secondary/assignment-s-01.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to compute the sum and product of digits of an integer using user diff --git a/Semester_1/assignment-secondary/assignment-s-02.c b/Semester_1/assignment-secondary/assignment-s-02.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to reverse a non-negative integer using a function. */ diff --git a/Semester_1/assignment-secondary/assignment-s-03.c b/Semester_1/assignment-secondary/assignment-s-03.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to compute the sum of the first n terms of the series using a function: diff --git a/Semester_1/assignment-secondary/assignment-s-04.c b/Semester_1/assignment-secondary/assignment-s-04.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function to check whether a number is prime or not. Use the same function to diff --git a/Semester_1/assignment-secondary/assignment-s-05.c b/Semester_1/assignment-secondary/assignment-s-05.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function to check whether a given string is a palindrome. Use this function to diff --git a/Semester_1/assignment-secondary/assignment-s-06.c b/Semester_1/assignment-secondary/assignment-s-06.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program using a function to compute and display all factors of a given number. */ diff --git a/Semester_1/assignment-secondary/assignment-s-07.c b/Semester_1/assignment-secondary/assignment-s-07.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to swap two numbers using a macro (#define). */ diff --git a/Semester_1/assignment-secondary/assignment-s-08.c b/Semester_1/assignment-secondary/assignment-s-08.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program that counts the number of occurrences of each alphabet (A-Z, a-z) in diff --git a/Semester_1/assignment-secondary/assignment-s-09.c b/Semester_1/assignment-secondary/assignment-s-09.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to swap two numbers using pointers (user-defined function). */ diff --git a/Semester_1/assignment-secondary/assignment-s-10.c b/Semester_1/assignment-secondary/assignment-s-10.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to swap two numbers using pointers (user-defined function). */ diff --git a/Semester_1/assignment-secondary/assignment-s-11.c b/Semester_1/assignment-secondary/assignment-s-11.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program that takes the radius of a circle as input, passes it to a function that diff --git a/Semester_1/assignment-secondary/assignment-s-12.c b/Semester_1/assignment-secondary/assignment-s-12.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find the sum of n elements entered by the user. Use dynamic diff --git a/Semester_1/assignment-secondary/assignment-s-13-1.c b/Semester_1/assignment-secondary/assignment-s-13-1.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 19 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function that reverses the elements of an array in place, using only a single diff --git a/Semester_1/assignment-secondary/assignment-s-13-2.c b/Semester_1/assignment-secondary/assignment-s-13-2.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 19 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function that reverses the elements of an array in place, using only a single diff --git a/Semester_1/assignment-secondary/assignment-s-14.c b/Semester_1/assignment-secondary/assignment-s-14.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 20 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/assignment-secondary/assignment-s-15.c b/Semester_1/assignment-secondary/assignment-s-15.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to merge two sorted integer arrays to form a single sorted array. */ diff --git a/Semester_1/assignment-secondary/assignment-s-16.c b/Semester_1/assignment-secondary/assignment-s-16.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program that reads 10 integers into an array (using pointers), and prints the diff --git a/Semester_1/assignment-secondary/assignment-s-17.c b/Semester_1/assignment-secondary/assignment-s-17.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to display the Fibonacci series diff --git a/Semester_1/assignment-secondary/assignment-s-18.c b/Semester_1/assignment-secondary/assignment-s-18.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to calculate the factorial of a number diff --git a/Semester_1/assignment-secondary/assignment-s-19.c b/Semester_1/assignment-secondary/assignment-s-19.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to calculate the GCD of two numbers diff --git a/Semester_1/assignment-secondary/assignment-s-20.c b/Semester_1/assignment-secondary/assignment-s-20.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a menu-driven program to perform the following matrix operations using 2-D diff --git a/Semester_1/assignment-secondary/assignment-s-21.c b/Semester_1/assignment-secondary/assignment-s-21.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 21 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to copy the contents of a text file to another file, after removing all diff --git a/Semester_1/assignment-secondary/assignment-s-22.c b/Semester_1/assignment-secondary/assignment-s-22.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program using structures to add two distances in meter-kilometer format. */ diff --git a/Semester_1/assignment-secondary/assignment-s-23.c b/Semester_1/assignment-secondary/assignment-s-23.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to add two complex numbers using structures. */ diff --git a/Semester_1/assignment-secondary/assignment-s-24.c b/Semester_1/assignment-secondary/assignment-s-24.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to calculate the difference between two time periods using structures. */ diff --git a/Semester_1/challenge/sudipto1.c b/Semester_1/challenge/sudipto1.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* A smart home security controller monitors the state of several sensors to decide what action to take. diff --git a/Semester_1/internal-practice/IP-01.c b/Semester_1/internal-practice/IP-01.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to compute the sum and product of digits of an integer using user diff --git a/Semester_1/internal-practice/IP-02.c b/Semester_1/internal-practice/IP-02.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to reverse a non-negative integer using a function. */ diff --git a/Semester_1/internal-practice/IP-03.c b/Semester_1/internal-practice/IP-03.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to compute the sum of the first n terms of the series using a function: diff --git a/Semester_1/internal-practice/IP-04.c b/Semester_1/internal-practice/IP-04.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a function to check whether a number is prime or not. Use the same function to diff --git a/Semester_1/internal-practice/IP-05.c b/Semester_1/internal-practice/IP-05.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a function to check whether a given string is a palindrome. Use this function to diff --git a/Semester_1/internal-practice/IP-06.c b/Semester_1/internal-practice/IP-06.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program using a function to compute and display all factors of a given number. */ diff --git a/Semester_1/internal-practice/IP-07.c b/Semester_1/internal-practice/IP-07.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to swap two numbers using pointers (user-defined function). */ diff --git a/Semester_1/internal-practice/IP-08.c b/Semester_1/internal-practice/IP-08.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program that takes the radius of a circle as input, passes it to a function that diff --git a/Semester_1/internal-practice/IP-09.c b/Semester_1/internal-practice/IP-09.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to find the sum of n elements entered by the user. Use dynamic diff --git a/Semester_1/internal-practice/IP-10.c b/Semester_1/internal-practice/IP-10.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a function that reverses the elements of an array in place, using only a single diff --git a/Semester_1/internal-practice/IP-11.c b/Semester_1/internal-practice/IP-11.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to merge two sorted integer arrays to form a single sorted array. */ diff --git a/Semester_1/internal-practice/IP-12.c b/Semester_1/internal-practice/IP-12.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program that reads 10 integers into an array (using pointers), and prints the diff --git a/Semester_1/internal-practice/IP-13.c b/Semester_1/internal-practice/IP-13.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to display the Fibonacci series diff --git a/Semester_1/internal-practice/IP-14.c b/Semester_1/internal-practice/IP-14.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to calculate the factorial of a number diff --git a/Semester_1/internal-practice/IP-15.c b/Semester_1/internal-practice/IP-15.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to calculate the GCD of two numbers diff --git a/Semester_1/internal-practice/IP-16.c b/Semester_1/internal-practice/IP-16.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a C program that includes a user-defined function named isArmstrong with the diff --git a/Semester_1/internal-practice/IP-17.c b/Semester_1/internal-practice/IP-17.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a C program that includes a user-defined function named isPerfect with the signature diff --git a/Semester_1/internal-practice/IP-18.c b/Semester_1/internal-practice/IP-18.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a C program that includes a user-defined function named findLargest with the diff --git a/Semester_1/internal-practice/IP-19.c b/Semester_1/internal-practice/IP-19.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a C program that includes a user-defined function named binarySearch with the diff --git a/Semester_1/internal-practice/IP-20.c b/Semester_1/internal-practice/IP-20.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a C program that defines an array of integers, and includes a user-defined function diff --git a/Semester_1/khurapati-idea/KI001.c b/Semester_1/khurapati-idea/KI001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ // khurapati idea no. : 1 diff --git a/Semester_1/khurapati-idea/KI002.c b/Semester_1/khurapati-idea/KI002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Author - Amit Dutta, Date - 05th November, 2025 */ diff --git a/Semester_1/khurapati-idea/KI003.c b/Semester_1/khurapati-idea/KI003.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 24 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Bubble sort (with swap) */ diff --git a/Semester_1/letusc/luc001.c b/Semester_1/letusc/luc001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Temperature of a city in fahrenheit degrees is input through diff --git a/Semester_1/letusc/luc002.c b/Semester_1/letusc/luc002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* The length and breadth of a rectangle and radius of a circle diff --git a/Semester_1/letusc/luc003.c b/Semester_1/letusc/luc003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Paper of size AO has dimensions 1189 mm x 841 mm. diff --git a/Semester_1/letusc/luc004.c b/Semester_1/letusc/luc004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* If a five digit number is input through the keyboard, diff --git a/Semester_1/letusc/luc005.c b/Semester_1/letusc/luc005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to recive Cartesian diff --git a/Semester_1/letusc/luc006.c b/Semester_1/letusc/luc006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to receive values of latitude (L1, L2) and longitude diff --git a/Semester_1/letusc/luc007.c b/Semester_1/letusc/luc007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Wind-chill factor is the felt air temperature on exposed skin due to wind. diff --git a/Semester_1/letusc/luc008.c b/Semester_1/letusc/luc008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* If value of an angle is input through the keyboard, diff --git a/Semester_1/letusc/luc009.c b/Semester_1/letusc/luc009.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Two numbers are input through the keyboard into two locations diff --git a/Semester_1/letusc/luc010.c b/Semester_1/letusc/luc010.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* A five-digit number is entered through the keyboard. Write a program diff --git a/Semester_1/letusc/luc011.c b/Semester_1/letusc/luc011.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* If ages of Ram, Shyam and Ajay are input through the keyboard, diff --git a/Semester_1/letusc/luc012.c b/Semester_1/letusc/luc012.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check whether a triangle is valid or not, diff --git a/Semester_1/letusc/luc013.c b/Semester_1/letusc/luc013.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find the absolute value diff --git a/Semester_1/letusc/luc014.c b/Semester_1/letusc/luc014.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Given the length and breadth of a rectangle, write a program to find diff --git a/Semester_1/letusc/luc015.c b/Semester_1/letusc/luc015.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Given three points (x1, y1), (x2, y2), and (x3, y3), diff --git a/Semester_1/letusc/luc016.c b/Semester_1/letusc/luc016.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Given the coordiantes (x, y) of center of a circle and its radius, diff --git a/Semester_1/letusc/luc017.c b/Semester_1/letusc/luc017.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Given a point (x, y), write a program to find out if it lies on X-axis, Y-axis or origin. */ diff --git a/Semester_1/letusc/luc018-logic.c b/Semester_1/letusc/luc018-logic.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* According to Gregorian calender, it was Monday on the date 01/01/01. diff --git a/Semester_1/letusc/luc018.c b/Semester_1/letusc/luc018.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* According to Gregorian calender, it was Monday on the date 01/01/01. diff --git a/Semester_1/letusc/luc019.c b/Semester_1/letusc/luc019.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* If the length of three sides of a triangle are entered through the diff --git a/Semester_1/letusc/luc020.c b/Semester_1/letusc/luc020.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* In digital world colors are specified in Red-Green-Blue (RGB) format, diff --git a/Semester_1/letusc/luc021.c b/Semester_1/letusc/luc021.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* A certain grade of steel is graded according to the following conditions: diff --git a/Semester_1/letusc/luc022.c b/Semester_1/letusc/luc022.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* The Body Mass Index (BMI) is defined as ratio of weight of the diff --git a/Semester_1/letusc/luc023.c b/Semester_1/letusc/luc023.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Using conditional operators determine : diff --git a/Semester_1/letusc/luc024.c b/Semester_1/letusc/luc024.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program using conditional operators to determine whether diff --git a/Semester_1/letusc/luc025.c b/Semester_1/letusc/luc025.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find the greates of the three numbers entered diff --git a/Semester_1/letusc/luc026.c b/Semester_1/letusc/luc026.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to recieve value of an angle in degreesand check diff --git a/Semester_1/letusc/luc027.c b/Semester_1/letusc/luc027.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Rewrite the folowing program using conditional operations diff --git a/Semester_1/letusc/luc028.c b/Semester_1/letusc/luc028.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print all the ASCII values and their equivalent diff --git a/Semester_1/letusc/luc029.c b/Semester_1/letusc/luc029.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print out all Armstrong numbers between 100 diff --git a/Semester_1/letusc/luc030.c b/Semester_1/letusc/luc030.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program for a matchstick game being played between the diff --git a/Semester_1/letusc/luc031-logic.c b/Semester_1/letusc/luc031-logic.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to enter numbers till the user wants. At the end it diff --git a/Semester_1/letusc/luc031.c b/Semester_1/letusc/luc031.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to enter numbers till the user wants. At the end it diff --git a/Semester_1/letusc/luc032.c b/Semester_1/letusc/luc032.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to recieve an integer and find its octal equivalent. diff --git a/Semester_1/letusc/luc033.c b/Semester_1/letusc/luc033.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find the range of a set of numbers entered diff --git a/Semester_1/letusc/luc034.c b/Semester_1/letusc/luc034.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print the multiplication table of the number diff --git a/Semester_1/letusc/luc035.c b/Semester_1/letusc/luc035.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* According to a study, the approximate level of intelligence of a diff --git a/Semester_1/letusc/luc036.c b/Semester_1/letusc/luc036.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* When interest compounds q times per year at an annual rate of diff --git a/Semester_1/letusc/luc037.c b/Semester_1/letusc/luc037.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* The natural logarithm can be approximated by the following series. diff --git a/Semester_1/letusc/luc038.c b/Semester_1/letusc/luc038.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to generate all Pythagorean Triplets with slide diff --git a/Semester_1/letusc/luc039.c b/Semester_1/letusc/luc039.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Population of a town today is 100000. The population has increased diff --git a/Semester_1/letusc/luc040-logic.c b/Semester_1/letusc/luc040-logic.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Ramanujan number (1729) is the smallest number that can be diff --git a/Semester_1/letusc/luc040.c b/Semester_1/letusc/luc040.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Ramanujan number (1729) is the smallest number that can be diff --git a/Semester_1/letusc/luc041.c b/Semester_1/letusc/luc041.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print 24 hours of day with suitable suffixes like diff --git a/Semester_1/letusc/luc042.c b/Semester_1/letusc/luc042.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to produce the following output : diff --git a/Semester_1/letusc/luc043.c b/Semester_1/letusc/luc043.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to find the grace marks for a student using switch. diff --git a/Semester_1/letusc/luc044.c b/Semester_1/letusc/luc044.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Any year is entered through the keyboard. Write a function to diff --git a/Semester_1/letusc/luc045.c b/Semester_1/letusc/luc045.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* A position integer is entered through the keyboard. Write a Function diff --git a/Semester_1/letusc/luc046.c b/Semester_1/letusc/luc046.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Given three variables x, y, z, write a function to circularly shift their diff --git a/Semester_1/letusc/luc047.c b/Semester_1/letusc/luc047.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Define a function that receives weight of a commodity in kilograms diff --git a/Semester_1/letusc/luc048.c b/Semester_1/letusc/luc048.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Define a function to compute the distance between two points and diff --git a/Semester_1/letusc/lucproblem001.c b/Semester_1/letusc/lucproblem001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Consider a currency system in which there are notes of six denominations, diff --git a/Semester_1/letusc/lucproblem002.c b/Semester_1/letusc/lucproblem002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* A year is entered through the keyboard, write a program to diff --git a/Semester_1/letusc/lucproblem003.c b/Semester_1/letusc/lucproblem003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* If a character is entered through the keyboard, Write a program diff --git a/Semester_1/letusc/lucproblem004.c b/Semester_1/letusc/lucproblem004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* If the lengths of three sides of a triangle are entered through the diff --git a/Semester_1/letusc/lucproblem005.c b/Semester_1/letusc/lucproblem005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to calculate overtime pay of 10 employees. Overtime is diff --git a/Semester_1/letusc/lucproblem006.c b/Semester_1/letusc/lucproblem006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find the factorial value of any number entered diff --git a/Semester_1/letusc/lucproblem007.c b/Semester_1/letusc/lucproblem007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Two numbers are entered through the keyboard. Write a program to diff --git a/Semester_1/letusc/lucproblem008.c b/Semester_1/letusc/lucproblem008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a problem to print all the prime numbers from 1 to 300. */ diff --git a/Semester_1/letusc/lucproblem009.c b/Semester_1/letusc/lucproblem009.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to add first seven terms of the following series using a diff --git a/Semester_1/letusc/lucproblem010-complex.c b/Semester_1/letusc/lucproblem010-complex.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to generate all combinations (permutations) of 1, 2 and 3 diff --git a/Semester_1/letusc/lucproblem010.c b/Semester_1/letusc/lucproblem010.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to generate all combination of 1, 2 and 3 using for loop. */ diff --git a/Semester_1/letusc/lucproblem011.c b/Semester_1/letusc/lucproblem011.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a menu driven program which has following options : diff --git a/Semester_1/letusc/lucproblem012.c b/Semester_1/letusc/lucproblem012.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a Function power(a, b), to calculate the value of a raised to b */ diff --git a/Semester_1/letusc/lucproblem013.c b/Semester_1/letusc/lucproblem013.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Define a function to convert any given year into its Roman equivalent. diff --git a/Semester_1/letusc/lucproblem014-short.c b/Semester_1/letusc/lucproblem014-short.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function that receives integers and returns the sum, average diff --git a/Semester_1/letusc/lucproblem014.c b/Semester_1/letusc/lucproblem014.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function that receives integers and returns the sum, average diff --git a/Semester_1/letusc/lucproblem015.c b/Semester_1/letusc/lucproblem015.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program that defines a function that calculates power of one diff --git a/Semester_1/letusc/lucproblem016.c b/Semester_1/letusc/lucproblem016.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Figure 9.4 shows three memory locations and values stored in them. diff --git a/Semester_1/practice-c/pc-ip-01.c b/Semester_1/practice-c/pc-ip-01.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-02.c b/Semester_1/practice-c/pc-ip-02.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-03.c b/Semester_1/practice-c/pc-ip-03.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-04.c b/Semester_1/practice-c/pc-ip-04.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-05.c b/Semester_1/practice-c/pc-ip-05.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-06.c b/Semester_1/practice-c/pc-ip-06.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-07.c b/Semester_1/practice-c/pc-ip-07.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-08.c b/Semester_1/practice-c/pc-ip-08.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-09.c b/Semester_1/practice-c/pc-ip-09.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-10.c b/Semester_1/practice-c/pc-ip-10.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-11.c b/Semester_1/practice-c/pc-ip-11.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-12.c b/Semester_1/practice-c/pc-ip-12.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-13.c b/Semester_1/practice-c/pc-ip-13.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-14.c b/Semester_1/practice-c/pc-ip-14.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-15.c b/Semester_1/practice-c/pc-ip-15.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-16.c b/Semester_1/practice-c/pc-ip-16.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-17.c b/Semester_1/practice-c/pc-ip-17.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 05 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-18.c b/Semester_1/practice-c/pc-ip-18.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-19.c b/Semester_1/practice-c/pc-ip-19.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc-ip-20.c b/Semester_1/practice-c/pc-ip-20.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 05 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* diff --git a/Semester_1/practice-c/pc001.c b/Semester_1/practice-c/pc001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/practice-c/pc002.c b/Semester_1/practice-c/pc002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/practice-c/pc003.c b/Semester_1/practice-c/pc003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/practice-c/pc004.c b/Semester_1/practice-c/pc004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/practice-c/pc005.c b/Semester_1/practice-c/pc005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/practice-c/pc006.c b/Semester_1/practice-c/pc006.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Prime number check */ diff --git a/Semester_1/practice-c/pc007.c b/Semester_1/practice-c/pc007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Armstrong number check only for three digit */ diff --git a/Semester_1/practice-c/pc008.c b/Semester_1/practice-c/pc008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Factorial upto N */ diff --git a/Semester_1/practice-c/pc009.c b/Semester_1/practice-c/pc009.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Sum of digit */ diff --git a/Semester_1/practice-c/pc010.c b/Semester_1/practice-c/pc010.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Reverse a number */ diff --git a/Semester_1/practice-c/pc011.c b/Semester_1/practice-c/pc011.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program that takes two positive integers, L (Lower Bound) diff --git a/Semester_1/practice-c/pc012.c b/Semester_1/practice-c/pc012.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C function that receives a string (character array) and uses diff --git a/Semester_1/tuition-c/APC-PRAC-001.c b/Semester_1/tuition-c/APC-PRAC-001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate area and perimeter of a rectangle diff --git a/Semester_1/tuition-c/APC-PRAC-002.c b/Semester_1/tuition-c/APC-PRAC-002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate area of a circle using math library diff --git a/Semester_1/tuition-c/APC-PRAC-003.c b/Semester_1/tuition-c/APC-PRAC-003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to accept diagonal of a square and calculate area, parimeter */ diff --git a/Semester_1/tuition-c/APC-PRAC-004.c b/Semester_1/tuition-c/APC-PRAC-004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate and display radius of a circle by taking the area as input. */ diff --git a/Semester_1/tuition-c/APC-PRAC-005.c b/Semester_1/tuition-c/APC-PRAC-005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP a program that accept number of days diff --git a/Semester_1/tuition-c/APC-PRAC-006.c b/Semester_1/tuition-c/APC-PRAC-006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP that accept seconds as input and represent it an hours, minutes and seconds. */ diff --git a/Semester_1/tuition-c/APC-PRAC-007.c b/Semester_1/tuition-c/APC-PRAC-007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP that accept basic salary of an employee and display gross salary, diff --git a/Semester_1/tuition-c/APC-PRAC-008.c b/Semester_1/tuition-c/APC-PRAC-008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to multiply and divide a number by 4 without diff --git a/Semester_1/tuition-c/APC-PRAC-009.c b/Semester_1/tuition-c/APC-PRAC-009.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to swap two integer variable without using Third variable. */ diff --git a/Semester_1/tuition-c/APC-PRAC-010.c b/Semester_1/tuition-c/APC-PRAC-010.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate and display the valve of the given expression : diff --git a/Semester_1/tuition-c/APC-PRAC-011.c b/Semester_1/tuition-c/APC-PRAC-011.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input positive number and check whether the number is diff --git a/Semester_1/tuition-c/APC-PRAC-012.c b/Semester_1/tuition-c/APC-PRAC-012.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input three integer and find out second largest */ diff --git a/Semester_1/tuition-c/APC-PRAC-013.c b/Semester_1/tuition-c/APC-PRAC-013.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input sum(p), rate of interest(r), time(t) and type of interest diff --git a/Semester_1/tuition-c/APC-PRAC-014.c b/Semester_1/tuition-c/APC-PRAC-014.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to calculate and display the maturity amount taking diff --git a/Semester_1/tuition-c/APC-PRAC-015.c b/Semester_1/tuition-c/APC-PRAC-015.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to display all numbers between lb (lower bound) and up (upper bound) diff --git a/Semester_1/tuition-c/APC-PRAC-016.c b/Semester_1/tuition-c/APC-PRAC-016.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check palindrome number. */ diff --git a/Semester_1/tuition-c/APC-PRAC-017.c b/Semester_1/tuition-c/APC-PRAC-017.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check perfect number. */ diff --git a/Semester_1/tuition-c/APC-PRAC-018.c b/Semester_1/tuition-c/APC-PRAC-018.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check Automorphic Number. */ diff --git a/Semester_1/tuition-c/APC-PRAC-019.c b/Semester_1/tuition-c/APC-PRAC-019.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to find hcf of two numbers */ diff --git a/Semester_1/tuition-c/APC-PRAC-020.c b/Semester_1/tuition-c/APC-PRAC-020.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check if two number is co-prime or not */ diff --git a/Semester_1/tuition-c/APC-PRAC-021.c b/Semester_1/tuition-c/APC-PRAC-021.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check special number (sum of digit + product of digit = original number) */ diff --git a/Semester_1/tuition-c/APC-PRAC-022.c b/Semester_1/tuition-c/APC-PRAC-022.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to accept a number and check whether the number is twisted prime or not */ diff --git a/Semester_1/tuition-c/APC-PRAC-023.c b/Semester_1/tuition-c/APC-PRAC-023.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Pattern : diff --git a/Semester_1/tuition-c/APC-PRAC-024.c b/Semester_1/tuition-c/APC-PRAC-024.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-025.c b/Semester_1/tuition-c/APC-PRAC-025.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-026.c b/Semester_1/tuition-c/APC-PRAC-026.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-027.c b/Semester_1/tuition-c/APC-PRAC-027.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-028.c b/Semester_1/tuition-c/APC-PRAC-028.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-029.c b/Semester_1/tuition-c/APC-PRAC-029.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-030.c b/Semester_1/tuition-c/APC-PRAC-030.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-031.c b/Semester_1/tuition-c/APC-PRAC-031.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-032.c b/Semester_1/tuition-c/APC-PRAC-032.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-033.c b/Semester_1/tuition-c/APC-PRAC-033.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Print the factorial of the digits off a number */ diff --git a/Semester_1/tuition-c/APC-PRAC-034.c b/Semester_1/tuition-c/APC-PRAC-034.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Take a Range as input from user and print the prime number between it. */ diff --git a/Semester_1/tuition-c/APC-PRAC-035.c b/Semester_1/tuition-c/APC-PRAC-035.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Print all the 3 and 4 digit palindrome number. */ diff --git a/Semester_1/tuition-c/APC-PRAC-036.c b/Semester_1/tuition-c/APC-PRAC-036.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Check krishnamurty number. */ diff --git a/Semester_1/tuition-c/APC-PRAC-037.c b/Semester_1/tuition-c/APC-PRAC-037.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Show all the armstrong number between a range. */ diff --git a/Semester_1/tuition-c/APC-PRAC-038.c b/Semester_1/tuition-c/APC-PRAC-038.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-039.c b/Semester_1/tuition-c/APC-PRAC-039.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-040.c b/Semester_1/tuition-c/APC-PRAC-040.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-041.c b/Semester_1/tuition-c/APC-PRAC-041.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* diff --git a/Semester_1/tuition-c/APC-PRAC-042.c b/Semester_1/tuition-c/APC-PRAC-042.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a function to check whether a given string is a palindrome. Use this function to diff --git a/Semester_1/tuition-c/APC-S-001.c b/Semester_1/tuition-c/APC-S-001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ #include<stdio.h> diff --git a/Semester_1/tuition-c/APC-S-002.c b/Semester_1/tuition-c/APC-S-002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ #include<stdio.h> diff --git a/Semester_1/tuition-c/APC-S-003.c b/Semester_1/tuition-c/APC-S-003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ #include <stdio.h> diff --git a/Semester_1/tuition-c/APC-S-004.c b/Semester_1/tuition-c/APC-S-004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Program to print first 10 natural numbers using while loop. */ diff --git a/Semester_1/tuition-c/APC-S-005.c b/Semester_1/tuition-c/APC-S-005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write to reverse a number. */ diff --git a/Semester_1/tuition-c/APC-S-006.c b/Semester_1/tuition-c/APC-S-006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print first 10 multiple of 5 */ diff --git a/Semester_1/tuition-c/APC-S-007.c b/Semester_1/tuition-c/APC-S-007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program the sum of first 10 natural numbers. */ diff --git a/Semester_1/tuition-c/APC-S-008.c b/Semester_1/tuition-c/APC-S-008.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to print the sum of two matrix as input given by the user. */ diff --git a/Semester_1/tuition-c/APC-S-009.c b/Semester_1/tuition-c/APC-S-009.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to find the upper and lower triangular matrix. */ diff --git a/Semester_1/tuition-c/APC-S-010.c b/Semester_1/tuition-c/APC-S-010.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input a new element at a specific position of an array. diff --git a/Semester_1/tuition-c/APC-S-011.c b/Semester_1/tuition-c/APC-S-011.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Linear search */ diff --git a/Semester_1/tuition-c/APC-S-012.c b/Semester_1/tuition-c/APC-S-012.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check if a matrix is a sparx matrix. */ diff --git a/Semester_1/tuition-c/APC-S-013.c b/Semester_1/tuition-c/APC-S-013.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a fuction to calculate the average of an array */ diff --git a/Semester_1/tuition-c/APC-S-014.c b/Semester_1/tuition-c/APC-S-014.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to store roll no, name and marks of 5 students then print it. use structure */ diff --git a/Semester_1/tuition-c/APC-SPS-001.c b/Semester_1/tuition-c/APC-SPS-001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ // WAP to perform arithmatic operation on integer data diff --git a/Semester_1/tuition-c/APC-SPS-002.c b/Semester_1/tuition-c/APC-SPS-002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to swap two integers. Display both numbers diff --git a/Semester_1/tuition-c/APC-SPS-003.c b/Semester_1/tuition-c/APC-SPS-003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Bitwise AND '&' */ diff --git a/Semester_1/tuition-c/APC-SPS-004.c b/Semester_1/tuition-c/APC-SPS-004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ #include<stdio.h> diff --git a/Semester_1/tuition-c/APC-SPS-005.c b/Semester_1/tuition-c/APC-SPS-005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Bitwise OR '|' */ diff --git a/Semester_1/tuition-c/APC-SPS-006.c b/Semester_1/tuition-c/APC-SPS-006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Bitwise NOT '~' */ diff --git a/Semester_1/tuition-c/APC-SPS-007.c b/Semester_1/tuition-c/APC-SPS-007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to check a number is even or odd using bitwise operator */ diff --git a/Semester_1/tuition-c/APC-SPS-008.c b/Semester_1/tuition-c/APC-SPS-008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate area of circle by accepting radius as input */ diff --git a/Semester_1/tuition-c/P001.c b/Semester_1/tuition-c/P001.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ //sample code diff --git a/Semester_1/tuition-c/P002.c b/Semester_1/tuition-c/P002.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ //sample code with a new line charecter diff --git a/Semester_1/tuition-c/P003.c b/Semester_1/tuition-c/P003.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ //WAP to perform addtion and multiplication of two integer numbers diff --git a/Semester_1/tuition-c/P004.c b/Semester_1/tuition-c/P004.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to find and display the value of given expression : diff --git a/Semester_1/tuition-c/P005.c b/Semester_1/tuition-c/P005.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* A person is paid Rs. 455 for each day he works and fined diff --git a/Semester_1/tuition-c/P006.c b/Semester_1/tuition-c/P006.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* The normal temperature of human body diff --git a/Semester_1/tuition-c/P007.c b/Semester_1/tuition-c/P007.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* A shopkeeper offers 10% discount on printed diff --git a/Semester_1/tuition-c/P008.c b/Semester_1/tuition-c/P008.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* A shopkeeper offers 30% discount on purchasing an diff --git a/Semester_1/tuition-c/P009.c b/Semester_1/tuition-c/P009.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate gross and net salary diff --git a/Semester_1/tuition-c/P010.c b/Semester_1/tuition-c/P010.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to find and display the difference diff --git a/Semester_1/tuition-c/P011.c b/Semester_1/tuition-c/P011.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* The time period of a simple pendulam is diff --git a/Semester_1/tuition-c/P012.c b/Semester_1/tuition-c/P012.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to swap two integer variable without diff --git a/Semester_1/tuition-c/P013.c b/Semester_1/tuition-c/P013.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to swap two integer variable without diff --git a/Semester_1/tuition-c/P014.c b/Semester_1/tuition-c/P014.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to accept the diagonal of diff --git a/Semester_1/tuition-c/P015.c b/Semester_1/tuition-c/P015.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /*WAP to accept number of days and diff --git a/Semester_1/tuition-c/P016.c b/Semester_1/tuition-c/P016.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate and display radius of a diff --git a/Semester_1/tuition-c/P017.c b/Semester_1/tuition-c/P017.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Find maximum between three number. */ diff --git a/Semester_1/tuition-c/P018.c b/Semester_1/tuition-c/P018.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input the cost price and selling price and diff --git a/Semester_1/tuition-c/P019.c b/Semester_1/tuition-c/P019.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input the distance covered and calculate diff --git a/Semester_1/tuition-c/P020.c b/Semester_1/tuition-c/P020.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate and display the maturity amount diff --git a/Semester_1/tuition-c/P021.c b/Semester_1/tuition-c/P021.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input a positive number and check if it is a perfect diff --git a/Semester_1/tuition-c/P022.c b/Semester_1/tuition-c/P022.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to find out smallest of three numbers without using if_else block. */ diff --git a/Semester_1/tuition-c/P023.c b/Semester_1/tuition-c/P023.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input the total cost and compute the amount to be paid diff --git a/Semester_1/tuition-c/P024.c b/Semester_1/tuition-c/P024.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to check whether a year is leapyear or not. */ diff --git a/Semester_1/tuition-c/P025.c b/Semester_1/tuition-c/P025.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input the electricity unit consumed and calculate the total diff --git a/Semester_1/tuition-c/P026.c b/Semester_1/tuition-c/P026.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input sum (p), rate of interest (r), time (t) and type of interest diff --git a/Semester_1/tuition-c/P027.c b/Semester_1/tuition-c/P027.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Purchase Discount on Discount on diff --git a/Semester_1/tuition-c/P028.c b/Semester_1/tuition-c/P028.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate factorial of a number */ diff --git a/Semester_1/tuition-c/P029.c b/Semester_1/tuition-c/P029.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ... */ diff --git a/Semester_1/tuition-c/P030.c b/Semester_1/tuition-c/P030.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Display the first 15 terms of the series. */ diff --git a/Semester_1/tuition-c/P031.c b/Semester_1/tuition-c/P031.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Find the sum of the series */ diff --git a/Semester_1/tuition-c/P032.c b/Semester_1/tuition-c/P032.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input a number and check whether it is a Niven number diff --git a/Semester_1/tuition-c/P033.c b/Semester_1/tuition-c/P033.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to calculate the sum of even digits and odd digits. Number will be provided by user. */ diff --git a/Semester_1/tuition-c/P034.c b/Semester_1/tuition-c/P034.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Get sum of even position digit and odd position digit */ diff --git a/Semester_1/tuition-c/P035.c b/Semester_1/tuition-c/P035.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to input an int number and display the product of the successors diff --git a/Semester_1/tuition-c/P036.c b/Semester_1/tuition-c/P036.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */ diff --git a/Semester_1/tuition-c/P037.c b/Semester_1/tuition-c/P037.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n */ diff --git a/Semester_1/tuition-c/P038.c b/Semester_1/tuition-c/P038.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to check prime number */ diff --git a/Semester_1/tuition-c/P039.c b/Semester_1/tuition-c/P039.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to print all the factors of a postive integer */ diff --git a/Semester_1/tuition-c/P040.c b/Semester_1/tuition-c/P040.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to calculate HCF of two positive number */ diff --git a/Semester_1/tuition-c/P041.c b/Semester_1/tuition-c/P041.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to enter two numbers and check they are co-prime or not. diff --git a/Semester_1/tuition-c/P042.c b/Semester_1/tuition-c/P042.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to accept a number and check whether the number diff --git a/Semester_1/tuition-c/P043.c b/Semester_1/tuition-c/P043.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to check palindrome number. */ diff --git a/Semester_1/tuition-c/P044.c b/Semester_1/tuition-c/P044.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to input a number and check whether the diff --git a/Semester_1/tuition-c/P045.c b/Semester_1/tuition-c/P045.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Make this pattern for input n. diff --git a/Semester_1/tuition-c/P046.c b/Semester_1/tuition-c/P046.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Make this pattern for input n. diff --git a/Semester_1/tuition-c/P047.c b/Semester_1/tuition-c/P047.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Make this pattern for input n. diff --git a/Semester_1/tuition-c/P048.c b/Semester_1/tuition-c/P048.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Make this pattern for input n no of row. diff --git a/Semester_1/tuition-c/P049.c b/Semester_1/tuition-c/P049.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Make this pattern for input n no of row. diff --git a/Semester_1/tuition-c/P050-SHORT.c b/Semester_1/tuition-c/P050-SHORT.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input a number and check whether it is Disarium Number or not. diff --git a/Semester_1/tuition-c/P050.c b/Semester_1/tuition-c/P050.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input a number and check whether it is Disarium Number or not. diff --git a/Semester_1/tuition-c/P051.c b/Semester_1/tuition-c/P051.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a program to input two number and check whether they are Amicable Pair or not diff --git a/Semester_1/tuition-c/P052.c b/Semester_1/tuition-c/P052.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Print the sum of this series for upto n element. diff --git a/Semester_1/tuition-c/P053.c b/Semester_1/tuition-c/P053.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Print all pattern */ diff --git a/Semester_1/tuition-c/P054.c b/Semester_1/tuition-c/P054.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* WAP to check Krishnamurty number using user defined methods/functions. */ diff --git a/Semester_1/tuition-c/P055.c b/Semester_1/tuition-c/P055.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to print n terms of Fibbonacci Series (Starting from term 0) */ diff --git a/Semester_1/tuition-c/P056.c b/Semester_1/tuition-c/P056.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to swap the value of a and b using user defined method. */ diff --git a/Semester_1/tuition-c/P057.c b/Semester_1/tuition-c/P057.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to display the series using user defined method. diff --git a/Semester_1/tuition-c/P058.c b/Semester_1/tuition-c/P058.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* WAP to display ASCII code of Alphabets (A - Z) using void displayASCII() */ diff --git a/Semester_1/tuition-c/P059.c b/Semester_1/tuition-c/P059.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to find the sum of array elements using following fuctions diff --git a/Semester_1/tuition-c/P060.c b/Semester_1/tuition-c/P060.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 13 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* write a C program to count the occurrences of a given element in an array using a user-defined diff --git a/Semester_1/tuition-c/P061.c b/Semester_1/tuition-c/P061.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta */ /* Write a C program to find the sum of even elements in an array using a user defined function. diff --git a/Semester_1/tuition-c/P062.c b/Semester_1/tuition-c/P062.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 16 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program to find the smallest and largest in an array using user-defined functions. diff --git a/Semester_1/tuition-c/P063.c b/Semester_1/tuition-c/P063.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 16 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a C program to find all Niven in an array. Define a user-defined function int isNiven(int num) diff --git a/Semester_1/tuition-c/P064.c b/Semester_1/tuition-c/P064.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta */ /* Write a program to merge two sorted integer arrays to form a single sorted array. */ diff --git a/Semester_1/tuition-c/P065.c b/Semester_1/tuition-c/P065.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program to reverse a string */ diff --git a/Semester_1/tuition-c/P066.c b/Semester_1/tuition-c/P066.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* WAP to find the length of a string using diff --git a/Semester_1/tuition-c/P067.c b/Semester_1/tuition-c/P067.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a program using function which concatenates two string s1 and s2 in to a third string */ diff --git a/Semester_1/tuition-c/P068.c b/Semester_1/tuition-c/P068.c @@ -1,15 +1,7 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta */ /* Write a c program that perform the operation of strcmp() */ diff --git a/Semester_1/tuition-c/P069.c b/Semester_1/tuition-c/P069.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 14 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program using user defined method to implement the following diff --git a/Semester_1/tuition-c/P070.c b/Semester_1/tuition-c/P070.c @@ -1,15 +1,9 @@ /* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== + * Author : Amit Dutta <amitdutta4255@gmail.com> + * Date : 24 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta */ /* Write a program to perform addition of two complex number having fields 'real' and 'img' diff --git a/docs/index.html b/docs/index.html @@ -1,21114 +1,18296 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <!-- Fix favicon 404 error --> - <link rel="icon" href="data:,"> - <title>notamitgamer/bsc Repository File Index</title> - - <!-- Fonts --> - <link rel="preconnect" href="https://fonts.googleapis.com"> - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> - <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> - - <!-- Tailwind CSS with Kinetic Terminal Configuration --> - <script src="https://cdn.tailwindcss.com"></script> - <script> - tailwind.config = { - theme: { - extend: { - fontFamily: { - sans: ['Inter', 'sans-serif'], - mono: ['JetBrains Mono', 'monospace'], - heading: ['Space Grotesk', 'sans-serif'], - }, - colors: { - blue: { - 50: 'rgba(190, 242, 100, 0.05)', - 100: 'rgba(190, 242, 100, 0.1)', - 200: '#d9f99d', - 300: '#bef264', - 400: '#a3d656', - 500: '#bef264', - 600: '#bef264', - 700: '#84cc16', - 800: '#3f6212', - 900: '#365314', - }, - slate: { - 50: '#050505', - 100: '#111111', - 200: '#27272a', - 300: '#404040', - 400: '#525252', - 500: '#737373', - 600: '#a1a1aa', - 700: '#d4d4d8', - 800: '#e4e4e7', - 900: '#f5f5f5', - } - } - } - } - } - </script> - - <!-- CodeMirror 5 (Professional Editor) --> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css"> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/dracula.min.css"> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/clike/clike.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/python/python.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/xml/xml.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/htmlmixed/htmlmixed.min.js"></script> - - <!-- LZ-String Compression --> - <script src="https://cdn.jsdelivr.net/npm/lz-string@1.5.0/libs/lz-string.min.js"></script> - - <style> - :root { - --bg-main: #050505; - --accent: #bef264; - --border-color: #27272a; - --text-main: #f5f5f5; - --text-muted: #737373; - } - - body { - font-family: "Inter", sans-serif; - background-color: var(--bg-main); - color: var(--text-main); - } - - h1, h2, h3, .font-heading { font-family: 'Space Grotesk', sans-serif; } - - /* Noise Texture */ - .bg-noise { - position: fixed; top: 0; left: 0; width: 100%; height: 100%; - pointer-events: none; z-index: 0; opacity: 0.03; - background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); - } - - /* CRT Scanline */ - .crt-scanline { - position: fixed; top: 0; left: 0; width: 100%; height: 2px; - background: rgba(190, 242, 100, 0.1); opacity: 0.5; - pointer-events: none; z-index: 50; - animation: scanline 8s linear infinite; - } - @keyframes scanline { 0% { top: -10vh; } 100% { top: 110vh; } } - - .chevron.rotated { - transform: rotate(180deg); - } - - .file-item:hover { - background-color: rgba(190, 242, 100, 0.05) !important; - border-color: rgba(190, 242, 100, 0.2) !important; - } - .folder-container > div:first-child:hover { - background-color: #111111 !important; - } - - .text-slate-700 { color: #d4d4d8 !important; } - .text-slate-600 { color: #a1a1aa !important; } - .text-slate-500 { color: #737373 !important; } - - #code-modal .modal-content-area { - height: 85vh; - max-height: 90vh; - background-color: #0d1117 !important; - border: 1px solid #30363d; - } - @media (min-width: 640px) { - #code-modal .modal-content-area { - height: 90vh; - } - } - - #modal-code-container { - padding: 0; - margin: 0; - height: 100%; - overflow: hidden; /* CodeMirror handles scroll */ - position: relative; - } - - /* CodeMirror Overrides */ - .CodeMirror { - height: 100% !important; - font-family: 'JetBrains Mono', monospace; - font-size: 13px; - background-color: #0d1117 !important; - color: #f8f8f2; - } - .CodeMirror-gutters { - background-color: #0d1117 !important; - border-right: 1px solid rgba(255,255,255,0.1) !important; - } - .CodeMirror-linenumber { - color: #6e7681 !important; - } - .CodeMirror-cursor { - border-left: 2px solid var(--accent) !important; - } - .CodeMirror-selected { - background: rgba(190, 242, 100, 0.2) !important; - } - - /* Scrollbar styling */ - .CodeMirror-scroll::-webkit-scrollbar, - ::-webkit-scrollbar { width: 10px; height: 10px; } - .CodeMirror-scroll::-webkit-scrollbar-track, - ::-webkit-scrollbar-track { background: #050505; } - .CodeMirror-scroll::-webkit-scrollbar-thumb, - ::-webkit-scrollbar-thumb { background: #27272a; border-radius: 5px; border: 2px solid #050505; } - .CodeMirror-scroll::-webkit-scrollbar-thumb:hover, - ::-webkit-scrollbar-thumb:hover { background: #bef264; } - - #app-content { display: none; } - - #back-to-top { transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; } - #back-to-top.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); } - - #toast { transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); } - #toast.show { transform: translateY(0); opacity: 1; } - - .file-item.nav-selected { background-color: rgba(190, 242, 100, 0.1) !important; border-color: #bef264 !important; } - .file-item.nav-selected span { color: #bef264 !important; } - - #modal-filename { color: #e6edf3; } - #code-loading { background-color: #0d1117; } - </style> - </head> - <body class="bg-slate-50 text-slate-900 h-screen flex flex-col overflow-hidden relative selection:bg-lime-300 selection:text-black"> - - <div class="bg-noise"></div> - <div class="crt-scanline"></div> - - <!-- App Wrapper --> - <div id="app-content" class="flex flex-col h-full overflow-hidden relative z-10"> - <!-- Header --> - <header - class="bg-[#050505]/90 backdrop-blur-md border-b border-white/10 px-4 sm:px-6 py-3 sm:py-4 flex flex-col sm:flex-row items-start sm:items-center justify-between shrink-0 shadow-sm z-10 gap-4 sm:gap-0 sticky top-0" - > - <!-- Logo Section --> - <div class="flex items-center gap-3 w-full sm:w-auto justify-between"> - <div class="flex items-center gap-3"> - <div class="p-2 bg-lime-300/10 rounded-lg shrink-0 border border-lime-300/20"> - <svg class="w-6 h-6 text-lime-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path> - </svg> - </div> - <div class="min-w-0"> - <h1 class="text-lg sm:text-xl font-bold text-white tracking-tight truncate font-heading">notamitgamer/bsc</h1> - <p class="text-xs text-neutral-500 font-medium mt-0.5 truncate font-mono">Repository File Index</p> - </div> - </div> - - <div class="flex items-center gap-2 sm:hidden"> - <button onclick="openLicenseModal(false)" class="p-2 text-neutral-400 hover:text-lime-300 bg-neutral-900 rounded-md transition-colors border border-neutral-800" title="View License"> - <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" /> - </svg> - </button> - <a href="https://github.com/notamitgamer/bsc" target="_blank" class="text-neutral-400 hover:text-white"> - <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - </div> - - <!-- Actions Section --> - <div class="flex items-center gap-3 w-full sm:w-auto flex-wrap sm:flex-nowrap"> - <button onclick="openLicenseModal(false)" class="hidden sm:flex items-center gap-2 px-3 py-2 text-sm font-medium text-neutral-400 hover:text-lime-300 hover:bg-lime-300/10 rounded-md transition-colors shrink-0 font-mono border border-transparent hover:border-lime-300/20" title="View License"> - <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" /></svg> - <span class="inline">License</span> - </button> - - <div class="relative group grow sm:grow-0 w-full sm:w-auto"> - <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> - <svg class="h-4 w-4 text-neutral-500 group-focus-within:text-lime-300 transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> - </div> - <input type="text" id="search-input" placeholder="Search code... (/)" class="pl-10 pr-10 sm:pr-4 py-2 bg-[#111] border border-neutral-800 rounded-lg text-sm w-full sm:w-64 focus:ring-1 focus:ring-lime-300/50 focus:border-lime-300/50 focus:bg-[#050505] transition-all outline-none text-neutral-200 placeholder:text-neutral-600 font-mono"/> - <div class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none hidden sm:flex"> - <span class="text-[10px] text-neutral-600 font-mono border border-neutral-800 rounded px-1.5 py-0.5 bg-[#111]">/</span> - </div> - </div> - - <a href="https://github.com/notamitgamer/bsc" target="_blank" class="hidden sm:flex bg-neutral-100 hover:bg-lime-300 text-black px-4 py-2 rounded-lg text-sm font-medium transition-all shadow-sm items-center gap-2 font-mono"> - <span>GitHub</span> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - </header> - - <!-- Main Content Area --> - <main class="flex-1 flex overflow-hidden relative" id="main-scroll-container"> - <!-- File Explorer --> - <div class="flex-1 overflow-y-auto p-4 sm:p-6 h-full" id="file-explorer-scroll"> - <div class="max-w-4xl mx-auto space-y-4"> - <div id="recent-files-container" class="hidden mb-6"> - <div class="flex items-center justify-between mb-3 px-1"> - <h2 class="text-xs font-bold text-neutral-500 uppercase tracking-wider font-mono">Recent Files</h2> - <button onclick="confirmClearRecent()" class="text-xs text-red-400 hover:text-red-500 font-medium transition-colors hover:underline font-mono">Clear</button> - </div> - <div id="recent-files-list" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2"></div> - <hr class="mt-4 border-white/10"> - </div> - - <div class="sticky top-0 z-20 bg-[#050505] py-2 flex justify-end gap-2 border-b border-white/10 backdrop-blur-sm bg-opacity-90 mb-2"> - <button id="btn-expand" onclick="expandAll()" class="text-xs font-bold text-neutral-500 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono" disabled>Expand All</button> - <span class="text-neutral-700">|</span> - <button id="btn-collapse" onclick="collapseAll()" class="text-xs font-bold text-neutral-500 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono" disabled>Collapse All</button> - </div> - - <div id="file-list-container"> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">Semester_1</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">assignment-primary</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-01-c', 'assignment-p-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-01.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-01.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-01-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named isPrime with the signature -int isPrime(int num); The function should take an integer as a parameter and return 1 if -the number is prime and 0 otherwise. */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int isPrime(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - - if (isPrime(n)) - { - printf(&quot;\nInput %d is a Prime Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is not a Prime Number.&quot;, n); - } - - return 0; -} - -int isPrime(int n) -{ - if (n &lt;= 1) - return 0; - if (n == 2) - return 1; - if (n % 2 == 0) - return 0; - - int temp = (int)sqrt(n); - int i; - for (i = 3; i &lt;= temp; i += 2) - { - if (n % i == 0) - { - return 0; - } - } - return 1; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-02-c', 'assignment-p-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-02.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-02.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-02-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named isArmstrong with the -signature int isArmstrong(int num);. An Armstrong number is a number that is equal to -the sum of its own digits each raised to the power of the number of digits. For example, -153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int isArmstrong(int); -int count(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - - if (isArmstrong(n)) - { - printf(&quot;\nInput %d is a Armstrong Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is Not a Armstrong Number.&quot;, n); - } - - return 0; -} - -int count(int n) -{ - int count = 0; - while (n &gt; 0) - { - count++; - n = n / 10; - } - return count; -} - -int isArmstrong(int n) -{ - if (n &lt; 0) - return 0; - if (n == 0) - return 1; - - int power = count(n); - int temp = n; - int checker = 0; - - while (temp &gt; 0) - { - int digit = temp % 10; - checker = checker + (int)round(pow(digit, power)); - temp = temp / 10; - } - return n == checker; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-03-c', 'assignment-p-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-03.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-03.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-03-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named isPerfect with the signature -int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of -its proper divisors, excluding itself. For example, 28 is a perfect number because the sum -of its divisors (1, 2, 4, 7, 14) equals 28. */ - -#include &lt;stdio.h&gt; - -int isPerfect(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (isPerfect(n)) - { - printf(&quot;\nInput %d is a Perfect Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is not a Perfect Number.&quot;, n); - } - return 0; -} - -int isPerfect(int n) -{ - if (n &lt;= 1) - return 0; - int temp = 1; - int i; - for (i = 2; i &lt;= n / 2; i++) - { - if (n % i == 0) - { - temp += i; - } - } - return temp == n; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-04-c', 'assignment-p-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-04.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-04.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-04-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that takes an integer input representing a month (1 to 12) and a year. -Use a switch statement to display the number of days in that month, considering leap years. */ - -#include &lt;stdio.h&gt; - -int main() -{ - int month, year, days; - printf(&quot;Enter the month (1 to 12) and year: &quot;); - scanf(&quot;%d %d&quot;, &amp;month, &amp;year); - - switch (month) - { - case 1: // jan - case 3: // mar - case 5: // may - case 7: // july - case 8: // aug - case 10: // oct - case 12: // dec - days = 31; - break; - case 4: // apr - case 6: // jun - case 9: // sep - case 11: // nov - days = 30; - break; - case 2: // feb - if ((year % 400 == 0) || ((year % 4 == 0) &amp;&amp; (year % 100 != 0))) - { - days = 29; - } - else - { - days = 28; - } - break; - default: - printf(&quot;\nYou entered something wrong.&quot;); - return 0; - } - - printf(&quot;\nNumber of days: %d&quot;, days); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-05-c', 'assignment-p-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-05.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-05.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-05-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that defines an array of integers, and includes a user-defined function -named reverseArray with the signature void reverseArray(int arr[], int size);. The function -should reverse the elements of the array. */ - -#include &lt;stdio.h&gt; - -void inputArray(int[], int); -void reverseArray(int[], int); - -int main() -{ - int size; - printf(&quot;How many element do you want to add: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - inputArray(arr, size); - reverseArray(arr, size); - return 0; -} - -void inputArray(int arr[], int size) -{ - int i; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -void reverseArray(int arr[], int size) -{ - int i, j, temp; - printf(&quot;\nBefore Reverse: \n&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); - } - for (i = 0, j = size - 1; i &lt; j; i++, j--) - { - temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - printf(&quot;\nAfter Reverse: \n&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-06-c', 'assignment-p-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-06.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-06.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-06-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named findLargest with the -signature int findLargest(int arr[], int size);. The function should take an array of integers -and its size, and return the largest element in the array. */ - -#include &lt;stdio.h&gt; - -void inputArray(int[], int); -int findLargest(int[], int); - -int main() -{ - int size; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - inputArray(arr, size); - printf(&quot;\nLargest Element is: %d&quot;, findLargest(arr, size)); - return 0; -} - -void inputArray(int arr[], int size) -{ - int i; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int findLargest(int arr[], int size) -{ - int largest = arr[0], i; - for (i = 1; i &lt; size; i++) - { - if (largest &lt; arr[i]) - { - largest = arr[i]; - } - } - return largest; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-07-c', 'assignment-p-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-07.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-07.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-07-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named binarySearch with the -signature int binarySearch(int arr[], int size, int target);. The function should perform a -binary search on a sorted array of integers and return the index of the target element if -found, and -1 otherwise. */ - -#include &lt;stdio.h&gt; - -int inputArray(int[], int); -// void sortArray(int[], int); -int binarySearch(int[], int, int); - -int main() -{ - int size; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - int target = inputArray(arr, size); - // sortArray(arr, size); - int index = binarySearch(arr, size, target); - if (index != -1) - { - printf(&quot;\nElement %d is found at index %d.&quot;, target, index); - } - else - { - printf(&quot;\nElement %d is not found.&quot;, target); - } - return 0; -} - -int inputArray(int arr[], int size) -{ - int i, target; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element for position %d: &quot;, i); - scanf(&quot;%d&quot;, &amp;arr[i]); - } - printf(&quot;\nEnter the target element: &quot;); - scanf(&quot;%d&quot;, &amp;target); - return target; -} - -/* void sortArray(int arr[], int size) -{ - // using Bubble Sort... - - int tempArr[size], i, j, temp; - printf(&quot;\nBefore Sorting:\n[&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i != size - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]\n&quot;); - for (i = 0; i &lt; size - 1; i++) - { - for (j = 0; j &lt; size - i - 1; j++) - { - if (arr[j] &gt; arr[j + 1]) - { - temp = arr[j]; - arr[j] = arr[j + 1]; - arr[j + 1] = temp; - } - } - } - printf(&quot;\nAfter Sorting:\n[&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i != size - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]\n&quot;); -} -*/ - -int binarySearch(int arr[], int size, int target) -{ - int low = 0; - int high = size - 1; - int mid; - while (low &lt;= high) - { - mid = low + ((high - low) / 2); - if (arr[mid] == target) - { - return mid; - } - else if (arr[mid] &gt; target) - { - high = mid - 1; - } - else if (arr[mid] &lt; target) - { - low = mid + 1; - } - } - return -1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-08-c', 'assignment-p-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-08.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-08.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-08-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named countSetBits with the -signature int countSetBits(int num);. The function should count and return the number of -set bits (1s) in the binary representation of the given number. */ - -#include &lt;stdio.h&gt; - -int countSetBits(int); - -int main() -{ - int num, result; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;num); - if (result = countSetBits(num)) - { - printf(&quot;\nNumber of set bits in %d: %d&quot;, num, result); - } - else - { - printf(&quot;\nThere is no set bits in %d&quot;, num); - } - return 0; -} - -int countSetBits(int num) -{ - int count = 0; - int mask= 1; - int i = 1; - while (i &lt;= 16) - { - if (num &amp; mask) - { - count++; - } - mask &lt;&lt;= 1; - i++; - } - return count; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-09-c', 'assignment-p-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-09.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-09.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-09-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named setBit with the signature -int setBit(int num, int position);. The function should set the bit at the specified position -(0-indexed) to 1 and return the modified number. */ - -#include &lt;stdio.h&gt; - -int setBit(int, int); - -int main() -{ - int num, position; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;num); - printf(&quot;Enter the postion where you want to set the bit (0-indexed): &quot;); - scanf(&quot;%d&quot;, &amp;position); - printf(&quot;\nModified number= %d&quot;, setBit(num, position)); - return 0; -} - -int setBit(int num, int position) -{ - int mask = 1 &lt;&lt; position; - return num | mask; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-10-c', 'assignment-p-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-10.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-10.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-10-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that defines a structure Rectangle with attributes length and width. -Include a user-defined function named calculateArea with the signature float -calculateArea(struct Rectangle r);. The function should calculate and return the area of -the rectangle. */ - -#include &lt;stdio.h&gt; - -struct Rectangle -{ - float length; - float width; -}; - -float calculateArea(struct Rectangle); - -int main() -{ - struct Rectangle rec; - printf(&quot;Enter the length of the Rectangle: &quot;); - scanf(&quot;%f&quot;, &amp;rec.length); - printf(&quot;Enter the width of the Rectangle: &quot;); - scanf(&quot;%f&quot;, &amp;rec.width); - printf(&quot;\nArea of the Rectangle = %g&quot;, calculateArea(rec)); -} - -float calculateArea(struct Rectangle r) -{ - return r.length * r.width; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-11-c', 'assignment-p-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-11.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-11-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that defines a structure Student containing the attributes rollNumber, -name, and marks. Include a user-defined function named displayStudent with the -signature void displayStudent(struct Student s);. The function should display the details -of a student. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; -#include &lt;stdlib.h&gt; - -struct Student -{ - int rollNumber; - char name[50]; - float marks; -}; - -void inputStudent(struct Student *); -void displayStudent(struct Student); - -int main() -{ - struct Student *std = NULL; - int i, n; - - printf(&quot;How many student details you want to add : &quot;); - if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) - { - printf(&quot;\nInvalid Input.&quot;); - return 1; - } - - std = (struct Student *)malloc(n * sizeof(struct Student)); - if (std == NULL) - { - printf(&quot;\nUnable to allocate memory.&quot;); - return 1; - } - - for (i = 0; i &lt; n; i++) - { - printf(&quot;\n- Enter details of Student %d -&quot;, i + 1); - inputStudent(&amp;std[i]); - } - - printf(&quot;\n=== Student Details ===\n&quot;); - for (i = 0; i &lt; n; i++) - { - displayStudent(std[i]); - } - - free(std); - return 0; -} - -void inputStudent(struct Student *std) -{ - int len; - - printf(&quot;\nEnter the Roll Number: &quot;); - scanf(&quot;%d&quot;, &amp;std-&gt;rollNumber); - getchar(); - - printf(&quot;Enter the Name (Max: 50 character): &quot;); - fgets(std-&gt;name, sizeof(std-&gt;name), stdin); - len = strlen(std-&gt;name); - if (len &gt; 0 &amp;&amp; std-&gt;name[len - 1] == &#x27;\n&#x27;) - { - std-&gt;name[len - 1] = &#x27;\0&#x27;; - } - - printf(&quot;Enter the Marks: &quot;); - scanf(&quot;%f&quot;, &amp;std-&gt;marks); -} - -void displayStudent(struct Student std) -{ - printf(&quot;\n%-12s : %d&quot;, &quot;Roll Number&quot;, std.rollNumber); - printf(&quot;\n%-12s : %s&quot;, &quot;Name&quot;, std.name); - printf(&quot;\n%-12s : %g\n&quot;, &quot;Marks&quot;, std.marks); -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-11-exe', 'assignment-p-11.exe', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.exe')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-11.exe</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.exe" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-11-exe" style="display:none;">MZ- -$-----3-i-^----`--Y\-\-F0-&quot;0-*-*-*-*-*-j*-)-[)-)-uEHUHD-)-)-f)-])-;)-W-(--yU-g-&#x27;-h&#x27;-7&#x27;-H -F%-d$-$---8#-P----H([^-N-O-O-S-S-S-HH([^HHEHH([^-H([^-O-N-WN-CN-M-LD-M-M-RM-@M- M--Invalid Input.-Unable to allocate memory.-- Enter details of Student %d --=== Student Details ===-Enter the Roll Number: -%-12s : %d-%-12s : %s-%-12s : %g ------&#x27;- -0 `pP--20`pP--r0`pP - -0`P--- --CHAR-LONG-LPSTR-HANDLE-LONGLONG-ULONGLONG-EXCEPTION_ROUTINE-PEXCEPTION_ROUTINE-M128A-XMM_SAVE_AREA32---PCONTEXT--EXCEPTION_RECORD-PEXCEPTION_RECORD--------NT_TIB-PNT_TIB--e_maxalloc-----IMAGE_DOS_HEADER-PIMAGE_DOS_HEADER-IMAGE_FILE_HEADER-IMAGE_DATA_DIRECTORY---PIMAGE_OPTIONAL_HEADER32---IMAGE_OPTIONAL_HEADER64-PIMAGE_OPTIONAL_HEADER64-PIMAGE_NT_HEADERS64-PIMAGE_NT_HEADERS-PIMAGE_TLS_CALLBACK--T-VT_BOOL-VT_DECIMAL-------_TCHAR----%-VT_BOOL-VT_DECIMAL-VT_BOOL-VT_DECIMAL--__mingw_raise_matherr-__mingw_setusermatherr--MEMORY_BASIC_INFORMATION-;-PIMAGE_SECTION_HEADER-VT_BOOL-VT_DECIMAL-------- - ------------------------VectorRegister-VectorControl-DebugControl-LastBranchToRip-LastBranchFromRip-LastExceptionToRip-LastExceptionFromRip-Reserved4-Xmm6-Xmm7-Xmm8-Xmm9-Xmm10-Xmm11-Xmm12-Xmm13-Xmm14-Xmm15----------VT_BOOL-VT_DECIMAL----VT_BOOL-VT_DECIMAL-p-R &quot;@-initialized-]---VectorRegister-VectorControl-DebugControl-LastBranchToRip-LastBranchFromRip-LastExceptionToRip-LastExceptionFromRip------Reserved4-Xmm6-Xmm7-Xmm8-Xmm9-Xmm10-Xmm11-Xmm12-Xmm13-Xmm14-Xmm15--------------------------_IMAGE_TLS_DIRECTORY64-u------A-A-VT_BOOL-VT_DECIMAL---VARENUM- VT_BOOL- VT_DECIMAL-onexitbegin-onexitend---VT_BOOL-VT_DECIMAL-- -&#x27;@-e_magic-e_cblp-e_cp-e_crlc-e_cparhdr-e_minalloc- -e_maxalloc-e_ss-e_sp-e_csum-e_ip-e_cs-e_lfarlc-e_ovno-e_res-e_oemid-e_oeminfo-e_res2-e_lfanew-Machine-NumberOfSections-PointerToSymbolTable-NumberOfSymbols-SizeOfOptionalHeader-Size-Magic-MajorLinkerVersion-MinorLinkerVersion-SizeOfCode-SizeOfInitializedData-SizeOfUninitializedData-AddressOfEntryPoint-BaseOfCode-ImageBase-SectionAlignment-FileAlignment-MajorOperatingSystemVersion-MinorOperatingSystemVersion-MajorImageVersion-MinorImageVersion-MajorSubsystemVersion-MinorSubsystemVersion-Win32VersionValue-SizeOfImage-SizeOfHeaders-CheckSum-Subsystem-DllCharacteristics-SizeOfStackReserve-SizeOfStackCommit-SizeOfHeapReserve-SizeOfHeapCommit-LoaderFlags-NumberOfRvaAndSizes-DataDirectory-Signature-FileHeader-OptionalHeader-;z --Name-Misc-SizeOfRawData-PointerToRawData-PointerToRelocations-PointerToLinenumbers-NumberOfRelocations-NumberOfLinenumbers--7 ---ForwarderChain-Name-FirstThunk--------------------J-F-----J-X86_TUNE_REASSOC_INT_TO_PARALLEL-X86_TUNE_PROLOGUE_USING_MOVE-__CTOR_LIST__-__DTOR_LIST__-COINITBASE_MULTITHREADED-VT_EMPTY-VT_NULL-VT_I2-VT_I4-VT_R4-VT_R8-VT_CY-VT_DATE-VT_BSTR-VT_DISPATCH-VT_ERROR- -VT_BOOL-VT_VARIANT-VT_UNKNOWN-VT_DECIMAL-VT_I1-VT_UI1-VT_UI2-VT_UI4-VT_I8-VT_UI8-VT_INT-VT_UINT-VT_VOID-VT_HRESULT-VT_PTR-VT_SAFEARRAY-VT_CARRAY-VT_USERDEFINED-VT_LPSTR-VT_LPWSTR-VT_RECORD-VT_INT_PTR-VT_UINT_PTR-VT_FILETIME-VT_BLOB-VT_STREAM-VT_STORAGE-VT_STREAMED_OBJECT-VT_STORED_OBJECT-VT_BLOB_OBJECT-VT_CF-VT_CLSID-VT_VERSIONED_STREAM-VT_BSTR_BLOB-VT_VECTOR-VT_ARRAY-VT_BYREF-VT_RESERVED-VT_ILLEGAL-VT_ILLEGALMASKED-VT_TYPEMASK-Target-Value----- ------------&amp;-.?: ; &#x27;@B--- : ;-------- -------4----- -- : ;----- : ;------ : ;-4--- --- : ;-------5--4-(----sJ -f|Jz.xt1z -Xut .YhZZ-KIw-2+iyg~MYZ2 .MYZ2-----Mf L!&lt;bA .wJ7&lt;x&lt;D ȻN ~{u.0-------tw.yy|g=jX----------~tw.~.tcMLuM\ -.=zJ--------A p -A -8A0A(A ABBA - -AAE -8A0A(A ABBE -R -AABBBA 8H -I K -E W -A ^ -J y -A -0A(A AABE -AC e -AJ -AAI -0A(A AABC u -0A(A AABE --J N-AAC o -AAA -AA PA-- AAAA I - AAAD Z AAA-AAD \AA-AF YA- AAAA Q - AAAG J AAA-AAA UAA-AAD n -AAA -(A AAAK f -(A AAAF I(A AAA- AAAH T - AAAA -AJ J -AE -A K -A ------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------- </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-12-c', 'assignment-p-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-12.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-12.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-12-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that takes multiple integers as command-line arguments and finds the -maximum and minimum value among them. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -// use atoi() - -int main(int argc, char *argv[]) -{ - int current_val, max_val, min_val, i; - char *endptr; - long first_arg_val; - if (argc &lt; 2) - { - printf(&quot;Usage: %s &lt;integer1&gt; &lt;integer2&gt; ...\n&quot;, argv[0]); - return 1; - } - first_arg_val = strtol(argv[1], &amp;endptr, 10); - if (*endptr != &#x27;\0&#x27; || argv[1] == endptr) - { - printf(&quot;Error: Argument &#x27;%s&#x27; is not a valid integer.\n&quot;, argv[1]); - return 1; - } - max_val = (int)first_arg_val; - min_val = (int)first_arg_val; - for (i = 2; i &lt; argc; i++) - { - long val = strtol(argv[i], &amp;endptr, 10); - if (*endptr != &#x27;\0&#x27; || argv[i] == endptr) - { - printf(&quot;Error: Argument &#x27;%s&#x27; is not a valid integer.\n&quot;, argv[i]); - return 1; - } - current_val = (int)val; - if (current_val &gt; max_val) - { - max_val = current_val; - } - if (current_val &lt; min_val) - { - min_val = current_val; - } - } - printf(&quot;The maximum value is: %d\n&quot;, max_val); - printf(&quot;The minimum value is: %d\n&quot;, min_val); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-13-c', 'assignment-p-13.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-13.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-13.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-13.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-13-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that accepts a string as a command line argument and includes a user- -defined function named isPalindrome with the signature int isPalindrome(char str[]);. -The function should check if the given string is a palindrome and return 1 if it is, and 0 -otherwise. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -int isPalindrome(char[]); - -int main(int argc, char *argv[]) -{ - if (argc != 2) - { - printf(&quot;\nUsage: %s &lt;string&gt;\n&quot;, argv[0]); - return 1; - } - if (isPalindrome(argv[1])) - { - printf(&quot;\nThe entered string \&quot;%s\&quot; is a Palindrome.\n&quot;, argv[1]); - } - else - { - printf(&quot;\nThe entered string \&quot;%s\&quot; is not Palindrome.\n&quot;, argv[1]); - } - return 0; -} - -int isPalindrome(char str[]) -{ - char *start = str; - char *end = str; - if (*end != &#x27;\0&#x27;) - { - while (*(end + 1) != &#x27;\0&#x27;) - { - end++; - } - } - else - { - return 1; - } - /* - Or we can use string.h instead of from line 33 to line 43 like this ... - - char *end; - int len = strlen(str); - if (len == 0) - { - return 1; - } - end = str + (len - 1); - - */ - while (start &lt; end) - { - if (*start != *end) - { - return 0; - } - start++; - end--; - } - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-14-c', 'assignment-p-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-14.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-14.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-14-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that opens its own source code file, reads its contents, and then prints -the contents to the console. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; -#include &lt;stdlib.h&gt; - -int main(int argc, char *argv[]) -{ - FILE *code; - int character, len_upto_dot; - char *FILENAME; - char *dot; - - FILENAME = strdup(argv[0]); - - if (FILENAME == NULL) - { - printf(&quot;\nMemory allocation failed.\n&quot;); - return 1; - } - - dot = strrchr(FILENAME, &#x27;.&#x27;); - - if (dot != NULL) - { - len_upto_dot = dot - FILENAME; - FILENAME[len_upto_dot] = &#x27;\0&#x27;; - } - - strcat(FILENAME, &quot;.c&quot;); - - code = fopen(FILENAME, &quot;r&quot;); - - if (code == NULL) - { - printf(&quot;\nCould not open the source file: %s&quot;, FILENAME); - printf(&quot;\nPlease ensure the source file is in the same directory as the executable.\n&quot;); - free(FILENAME); - return 1; - } - - printf(&quot;\nReading file: %s&quot;, FILENAME); - printf(&quot;\n========== %s ==========\n\n&quot;, FILENAME); - - while ((character = fgetc(code)) != EOF) - { - putchar(character); - } - - printf(&quot;\n\n========== End of %s ==========\n&quot;, FILENAME); - - fclose(code); - free(FILENAME); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-15-c', 'assignment-p-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-15.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-15.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-primary-assignment-p-15-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that reads a sequence of integers from a file named &#x27;input.txt&#x27;. This -program should segregate the odd numbers from the even numbers and store the odd -numbers in a new file named &#x27;ODDFile.txt&#x27; while storing the even numbers in another file -named &#x27;EVENFile.txt&#x27; */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;string.h&gt; - -#define FILENAME &quot;input.txt&quot; -#define ODDFILE &quot;ODDFile.txt&quot; -#define EVENFILE &quot;EVENFile.txt&quot; - -int main() -{ - FILE *numbers = NULL; - FILE *oddfile = NULL; - FILE *evenfile = NULL; - int num; - numbers = fopen(FILENAME, &quot;r&quot;); - if (numbers == NULL) - { - printf(&quot;\nCould not open the file: %s&quot;, FILENAME); - return 1; - } - oddfile = fopen(ODDFILE, &quot;w&quot;); - if (oddfile == NULL) - { - printf(&quot;\nCould not open the file: %s&quot;, ODDFILE); - return 1; - } - evenfile = fopen(EVENFILE, &quot;w&quot;); - if (evenfile == NULL) - { - printf(&quot;\nCould not open the file: %s&quot;, EVENFILE); - return 1; - } - while (fscanf(numbers, &quot;%d&quot;, &amp;num) == 1) - { - if (num % 2 == 0) - { - fprintf(evenfile, &quot;%d &quot;, num); - } - else - { - fprintf(oddfile, &quot;%d &quot;, num); - } - } - printf(&quot;\nSuccessfully processed numbers from %s.\n&quot;, FILENAME); - printf(&quot;Odd numbers written to %s.\n&quot;, ODDFILE); - printf(&quot;Even numbers written to %s.\n&quot;, EVENFILE); - - fclose(numbers); - fclose(oddfile); - fclose(evenfile); - - return 0; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">assignment-secondary</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-01-c', 'assignment-s-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-01.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-01.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-01-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to compute the sum and product of digits of an integer using user -defined functions. */ - -#include &lt;stdio.h&gt; - -int sum_of_digits(int); -int product_of_digits(int); - -int main() -{ - int num; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;num); - printf(&quot;\nSum of digits of %d = %d&quot;, num, sum_of_digits(num)); - printf(&quot;\nProduct of digits of %d = %d&quot;, num, product_of_digits(num)); - return 0; -} - -int sum_of_digits(int num) -{ - int sum = 0; - while (num &gt; 0) - { - sum += num % 10; - num /= 10; - } - return sum; -} - -int product_of_digits(int num) -{ - int product = 1; - while (num &gt; 0) - { - product *= num % 10; - num /= 10; - } - return product; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-02-c', 'assignment-s-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-02.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-02.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-02-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to reverse a non-negative integer using a function. */ - -#include &lt;stdio.h&gt; - -int reverse(int); - -int main() -{ - int num; - printf(&quot;Enter a non-negetive integer: &quot;); - scanf(&quot;%d&quot;, &amp;num); - if (num &lt; 0) - { - printf(&quot;\nOnly non-negetive integers are allowed.&quot;); - return 1; - } - printf(&quot;\nReverse of the integer %d = %d&quot;, num, reverse(num)); - return 0; -} - -int reverse(int num) -{ - int rev = 0; - while (num &gt; 0) - { - rev = (rev * 10) + (num % 10); - num /= 10; - } - return rev; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-03-c', 'assignment-s-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-03.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-03.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-03-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to compute the sum of the first n terms of the series using a function: -S=1−2+3−4+5−6+… */ - -#include &lt;stdio.h&gt; - -int sum_of_series(int); - -int main() -{ - int n; - printf(&quot;Enter the n: &quot;); - scanf(&quot;%d&quot;, &amp;n); - printf(&quot;\nSum of the first %d terms of the series = %d&quot;, n, sum_of_series(n)); - return 0; -} - -int sum_of_series(int n) -{ - int sum = 0; - int i; - for (i = 1; i &lt;= n; i++) - { - if (i % 2 == 0) - { - sum -= i; - } - else - { - sum += i; - } - } - return sum; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-04-c', 'assignment-s-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-04.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-04.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-04-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function to check whether a number is prime or not. Use the same function to -generate all prime numbers less than 100. */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int isPrime(int); - -int main() -{ - int n, i; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (isPrime(n)) - { - printf(&quot;\nInput %d is a Prime Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is not a Prime Number.&quot;, n); - } - printf(&quot;\nPrime Numbers less than 100:&quot;); - for (i = 1; i &lt; 100; i++) - { - if (isPrime(i)) - { - printf(&quot; %d&quot;, i); - } - } - return 0; -} - -int isPrime(int n) -{ - if (n &lt;= 1) - return 0; - if (n == 2) - return 1; - if (n % 2 == 0) - return 0; - - int temp = (int)sqrt(n); - int i; - for (i = 3; i &lt;= temp; i += 2) - { - if (n % i == 0) - { - return 0; - } - } - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-05-c', 'assignment-s-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-05.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-05.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-05-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function to check whether a given string is a palindrome. Use this function to -determine whether an entered string is Palindrome. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -int isPalindrome(char[]); - -int main() -{ - char input[100]; - int len; - - printf(&quot;Enter the string (Max: 100 Character): &quot;); - fgets(input, sizeof(input), stdin); - len = strlen(input); - - if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) - { - input[len - 1] = &#x27;\0&#x27;; - } - - if (isPalindrome(input)) - { - printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); - } - else - { - printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); - } - - return 0; -} - -int isPalindrome(char str[]) -{ - char *start = str; - char *end; - int len = strlen(str); - - if (len == 0) - { - return 1; - } - - end = str + (len - 1); - - while (start &lt; end) - { - if (*start != *end) - { - return 0; - } - start++; - end--; - } - - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-06-c', 'assignment-s-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-06.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-06.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-06-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using a function to compute and display all factors of a given number. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void display_factors(int); - -int main() -{ - int num, i; - printf(&quot;Please enter the number to get the factors from it : &quot;); - scanf(&quot;%d&quot;, &amp;num); - display_factors(num); - return 0; -} - -void display_factors(int num) { - int temp = abs(num); - int i; - - if (temp == 0) - { - printf(&quot;\n0 has infinitely many factors (all integers).&quot;); - exit(1); - } - - printf(&quot;\nThe factors of &#x27; %d &#x27; is :- &quot;, num); - printf(&quot;\nPositive : &quot;); - for (i = 1; i &lt;= temp; i++) - if (temp % i == 0) - printf(&quot; %d&quot;, i); - printf(&quot;\nNegative : &quot;); - for (i = 1; i &lt;= temp; i++) - if (temp % i == 0) - printf(&quot; %d&quot;, -i); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-07-c', 'assignment-s-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-07.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-07.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-07-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to swap two numbers using a macro (#define). */ - -// IMPOSSIBLE -/* It is impossible to swap two literal numbers defined using the -preprocessor directive #define. This is because #define performs simple -text substitution and does not create variables in memory that can be -manipulated or pointed to. */ - -// Using a Function-Like Macro - -#include &lt;stdio.h&gt; - -// Define the SWAP macro. -// The do-while(0) block is a common trick to ensure the macro behaves -// like a single statement, regardless of where it is used (e.g., inside an &#x27;if&#x27; statement). -#define SWAP(a, b, data_type) \ - do { \ - data_type temp = a; \ - a = b; \ - b = temp; \ - } while(0) - -int main() { - int num1 = 15; - int num2 = 42; - - printf(&quot;--- Before Swap ---\n&quot;); - printf(&quot;Number 1 (num1): %d\n&quot;, num1); - printf(&quot;Number 2 (num2): %d\n&quot;, num2); - - // Call the macro, passing the variables and their type - // The preprocessor replaces this line with the block of code defined above. - SWAP(num1, num2, int); - - printf(&quot;\n--- After Swap (using macro) ---\n&quot;); - printf(&quot;Number 1 (num1): %d\n&quot;, num1); - printf(&quot;Number 2 (num2): %d\n&quot;, num2); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-08-c', 'assignment-s-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-08.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-08.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-08-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that counts the number of occurrences of each alphabet (A-Z, a-z) in -the text entered using Command-Line Arguments. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -int main(int argc, char *argv[]) -{ - int target[2], i, j, count[2], len; - for (target[0] = &#x27;A&#x27;, target[1] = &#x27;a&#x27;; target[0] &lt;= &#x27;Z&#x27;, target[1] &lt;= &#x27;z&#x27;; target[0]++, target[1]++) - { - count[0] = 0; - count[1] = 0; - for (i = 1; i &lt; argc; i++) - { - len = strlen(argv[i]); - for (j = 0; j &lt; len; j++) - { - if (argv[i][j] == target[0]) - { - count[0]++; - } - if (argv[i][j] == target[1]) - { - count[1]++; - } - } - } - if (count[0]) - { - printf(&quot;\n\&quot;%c\&quot; found %d times.&quot;, target[0], count[0]); - } - if (count[1]) - { - printf(&quot;\n\&quot;%c\&quot; found %d times.&quot;, target[1], count[1]); - } - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-09-c', 'assignment-s-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-09.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-09.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-09-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to swap two numbers using pointers (user-defined function). */ - -#include &lt;stdio.h&gt; - -void swap(int *, int *); - -int main() -{ - int a, b; - printf(&quot;Enter value for a and b: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - printf(&quot;\nBefore Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - swap(&amp;a, &amp;b); - printf(&quot;\nAfter Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - return 0; -} - -void swap(int *a, int *b) -{ - *a = *a ^ *b; - *b = *a ^ *b; - *a = *a ^ *b; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-10-c', 'assignment-s-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-10.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-10.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-10-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to swap two numbers using pointers (user-defined function). */ - -#include &lt;stdio.h&gt; - -void swap(int *, int *); - -int main() -{ - int a, b; - printf(&quot;Enter value for a and b: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - printf(&quot;\nBefore Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - swap(&amp;a, &amp;b); - printf(&quot;\nAfter Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - return 0; -} - -void swap(int *a, int *b) -{ - *a = *a ^ *b; - *b = *a ^ *b; - *a = *a ^ *b; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-11-c', 'assignment-s-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-11.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-11.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-11-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that takes the radius of a circle as input, passes it to a function that -computes area and circumference, and displays results in main(). */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -void area_circumference(double, double *, double *); - -int main() -{ - double r, area, circumference; - printf(&quot;Enter the radius of the circle: &quot;); - scanf(&quot;%lf&quot;, &amp;r); - area_circumference(r, &amp;area, &amp;circumference); - printf(&quot;\nArea of the circle = %g&quot;, area); - printf(&quot;\nCircumference of the circle = %g&quot;, circumference); - return 0; -} - -void area_circumference(double r, double *area, double *circumference) -{ - *area = M_PI * r * r; - *circumference = 2 * M_PI * r; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-12-c', 'assignment-s-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-12.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-12.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-12-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the sum of n elements entered by the user. Use dynamic -memory allocation (malloc() or calloc()). */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputarr(int[], int); -int sum_elem(int[], int); - -int main() -{ - int n, *arr; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;n); - arr = (int *)malloc(n * sizeof(int)); - inputarr(arr, n); - printf(&quot;\nSum of the %d element(s) = %d&quot;, n, sum_elem(arr, n)); - free(arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int sum_elem(int arr[], int n) -{ - int i, sum = 0; - for (i = 0; i &lt; n; i++) - { - sum += arr[i]; - } - return sum; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-13-1-c', 'assignment-s-13-1.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-1.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-13-1.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-1.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-13-1-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function that reverses the elements of an array in place, using only a single -pointer argument, and return void. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputarr(int[], int); -void display(int[], int); -void reverse(int *); - -int main() -{ - int size, *arr; - printf(&quot;How many element do you want to add: &quot;); - scanf(&quot;%d&quot;, &amp;size); - arr = (int *)malloc((size + 1) * sizeof(int)); - inputarr(arr, size); - printf(&quot;\n=== Before Reverse ===\n&quot;); - display(arr, size); - reverse(arr); - printf(&quot;\n\n=== After Reverse ===\n&quot;); - display(arr, size); - free(arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - arr[0] = n; - for (i = 1; i &lt;= n; i++) - { - printf(&quot;Enter element %d: &quot;, i); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -void display(int arr[], int n) -{ - int i; - for (i = 1; i &lt;= n; i++) - { - printf(&quot;\nIndex: %-2d | Value: %-5d | Address: %p&quot;, i, arr[i], (void *)&amp;arr[i]); - } -} - -void reverse(int *arr) -{ - int *start = arr + 1; - int size = *arr; - int *end = arr + size; - while (start &lt; end) - { - *start = *start ^ *end; - *end = *start ^ *end; - *start = *start ^ *end; - start++; - end--; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-13-2-c', 'assignment-s-13-2.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-2.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-13-2.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-2.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-13-2-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function that reverses the elements of an array in place, using only a single -pointer argument, and return void. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -struct Array -{ - int size; - int *arr; -}; - -void inputarr(int[], int); -void display(int[], int); -void reverse(struct Array *); - -int main() -{ - struct Array array; - printf(&quot;How many element do you want to add: &quot;); - scanf(&quot;%d&quot;, &amp;array.size); - array.arr = (int *)malloc((array.size) * sizeof(int)); - inputarr(array.arr, array.size); - printf(&quot;\n=== Before Reverse ===\n&quot;); - display(array.arr, array.size); - reverse(&amp;array); - printf(&quot;\n\n=== After Reverse ===\n&quot;); - display(array.arr, array.size); - free(array.arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -void display(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;\nIndex: %-2d | Value: %-5d | Address: %p&quot;, i, arr[i], (void *)&amp;arr[i]); - } -} - -void reverse(struct Array *array) -{ - int *start = array-&gt;arr; - int *end = array-&gt;arr + (array-&gt;size - 1); - while (start &lt; end) - { - *start = *start ^ *end; - *end = *start ^ *end; - *start = *start ^ *end; - start++; - end--; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-14-c', 'assignment-s-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-14.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-14.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-14-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* - Write a menu-driven program to perform the following string operations: - a. Show address of each character - b. Concatenate two strings without using strcat() - c. Concatenate two strings using strcat() - d. Compare two strings - e. Find string length using pointers - f. Convert lowercase to uppercase - g. Convert uppercase to lowercase - h. Count number of vowels - i. Reverse the string -*/ - -#include &lt;stdio.h&gt; -#include &lt;ctype.h&gt; -#include &lt;string.h&gt; - -void address_char(char *); -void concat_manual(char[], char[]); -void concat_strcat(char[], char[]); -int string_cmp(char *, char *); -int string_len(char *); -void ltou(char[]); -void utol(char[]); -int vowel_count(char[]); -void reverse(char[]); - -int main() -{ - char str1[100], str2[100], choice; - int result_cmp; - - printf(&quot;Enter first string (Max: 100 character): &quot;); - fgets(str1, sizeof(str1), stdin); - str1[strcspn(str1, &quot;\n&quot;)] = &#x27;\0&#x27;; - // this will replace the enter (\n) used in the end to null - - printf(&quot;Enter second string (Max: 100 character): &quot;); - fgets(str2, sizeof(str2), stdin); - str2[strcspn(str2, &quot;\n&quot;)] = &#x27;\0&#x27;; - - while (1) - { - printf(&quot;\n\n\n ========== MENU ==========\n&quot; - &quot;a. Show address of each character\n&quot; - &quot;b. Concatenate two strings without using strcat()\n&quot; - &quot;c. Concatenate two strings using strcat()\n&quot; - &quot;d. Compare two strings\n&quot; - &quot;e. Find string length using pointers\n&quot; - &quot;f. Convert lowercase to uppercase\n&quot; - &quot;g. Convert uppercase to lowercase\n&quot; - &quot;h. Count number of vowels\n&quot; - &quot;i. Reverse the string\n&quot; - &quot;1. Change input strings\n&quot; - &quot;0. Exit\n&quot;); - printf(&quot;\nEnter your choice: &quot;); - scanf(&quot; %c&quot;, &amp;choice); - choice = tolower(choice); - - switch (choice) - { - case &#x27;1&#x27;: - while (getchar() != &#x27;\n&#x27;) - ; - printf(&quot;Enter first string (Max: 100 character): &quot;); - fgets(str1, sizeof(str1), stdin); - str1[strcspn(str1, &quot;\n&quot;)] = &#x27;\0&#x27;; - - printf(&quot;Enter second string (Max: 100 character): &quot;); - fgets(str2, sizeof(str2), stdin); - str2[strcspn(str2, &quot;\n&quot;)] = &#x27;\0&#x27;; - - break; - case &#x27;0&#x27;: - printf(&quot;\n\n\nExiting program...\n\n&quot;); - return 0; - - case &#x27;a&#x27;: - printf(&quot;\n --- Show address of each character ---\n&quot;); - printf(&quot;\nSrting 1: &quot;); - address_char(str1); - printf(&quot;\nString 2: &quot;); - address_char(str2); - break; - case &#x27;b&#x27;: - printf(&quot;\n --- Concatenate two strings without using strcat() ---\n&quot;); - printf(&quot;\nResult: &quot;); - concat_manual(str1, str2); - break; - case &#x27;c&#x27;: - printf(&quot;\n --- Concatenate two strings using strcat() ---\n&quot;); - printf(&quot;\nResult: &quot;); - concat_strcat(str1, str2); - break; - case &#x27;d&#x27;: - printf(&quot;\n --- Compare two strings ---\n&quot;); - result_cmp = string_cmp(str1, str2); - if (result_cmp == 0) - { - printf(&quot;\nString 1 = String 2&quot;); - break; - } - else if (result_cmp &gt; 0) - { - printf(&quot;\nString 1 &gt; String 2&quot;); - break; - } - else - { - printf(&quot;\nString 1 &lt; String 2&quot;); - break; - } - case &#x27;e&#x27;: - printf(&quot;\n --- Find string length using pointers ---\n&quot;); - printf(&quot;\nLength of the String_1: %d&quot;, string_len(str1)); - printf(&quot;\nLength of the String_2: %d&quot;, string_len(str2)); - break; - case &#x27;f&#x27;: - printf(&quot;\n --- Convert lowercase to uppercase ---\n&quot;); - printf(&quot;\nString 1: &quot;); - ltou(str1); - printf(&quot;\nString 2: &quot;); - ltou(str2); - break; - case &#x27;g&#x27;: - printf(&quot;\n --- Convert uppercase to lowercase ---\n&quot;); - printf(&quot;\nString 1: &quot;); - utol(str1); - printf(&quot;\nString 2: &quot;); - utol(str2); - break; - case &#x27;h&#x27;: - printf(&quot;\n --- Count number of vowels ---\n&quot;); - printf(&quot;\nString 1: %d&quot;, vowel_count(str1)); - printf(&quot;\nString 2: %d&quot;, vowel_count(str2)); - break; - case &#x27;i&#x27;: - printf(&quot;\n --- Reverse the string ---\n&quot;); - printf(&quot;\nString 1: &quot;); - reverse(str1); - printf(&quot;\nString 2: &quot;); - reverse(str2); - break; - default: - printf(&quot;\nWrong choice. Try again...\n&quot;); - } - } -} - -void address_char(char *str) -{ - printf(&quot;\nCharacter | Memory Address&quot;); - printf(&quot;\n--------- | --------------&quot;); - - while (*str != &#x27;\0&#x27;) - { - printf(&quot;\n %-6c| %p&quot;, *str, (void *)str); - str++; - } -} - -void concat_manual(char str1[], char str2[]) -{ - int size1 = strlen(str1); - int size2 = strlen(str2); - char result[size1 + size2 + 1]; - int i = 0, j; - - j = 0; - while (str1[j] != &#x27;\0&#x27;) - { - result[i] = str1[j]; - i++; - j++; - } - - j = 0; - while (str2[j] != &#x27;\0&#x27;) - { - result[i] = str2[j]; - i++; - j++; - } - - result[i] = &#x27;\0&#x27;; - printf(&quot;%s\n&quot;, result); -} - -void concat_strcat(char str1[], char str2[]) -{ - int size1 = strlen(str1); - int size2 = strlen(str2); - char result[size1 + size2 + 1]; - - result[0] = &#x27;\0&#x27;; - strcat(result, str1); - strcat(result, str2); - - printf(&quot;%s\n&quot;, result); -} - -int string_cmp(char *str1, char *str2) -{ - // written based on strcmp() - while (*str1 != &#x27;\0&#x27; &amp;&amp; (*str1 == *str2)) - { - str1++; - str2++; - } - return (*str1 - *str2); -} - -int string_len(char *str) -{ - char *end = str; - while (*end != &#x27;\0&#x27;) - { - end++; - } - return end - str; -} - -void ltou(char str[]) -{ - int i; - for (i = 0; str[i] != &#x27;\0&#x27;; i++) - { - printf(&quot;%c&quot;, toupper(str[i])); - } -} - -void utol(char str[]) -{ - int i; - for (i = 0; str[i] != &#x27;\0&#x27;; i++) - { - printf(&quot;%c&quot;, tolower(str[i])); - } -} - -int vowel_count(char str[]) -{ - int i, vowel = 0; - char character; - for (i = 0; str[i] != &#x27;\0&#x27;; i++) - { - character = tolower(str[i]); - if (character == &#x27;a&#x27; || character == &#x27;e&#x27; || character == &#x27;i&#x27; || character == &#x27;o&#x27; || character == &#x27;u&#x27;) - { - vowel++; - } - } - return vowel; -} - -void reverse(char str[]) -{ - int len = strlen(str); - char result[len + 1]; - char *start = result; - char *end = result + len - 1; - char temp; - - result[0] = &#x27;\0&#x27;; - strcat(result, str); - - while (start &lt; end) - { - temp = *start; - *start = *end; - *end = temp; - start++; - end--; - } - printf(&quot;%s\n&quot;, result); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-15-c', 'assignment-s-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-15.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-15.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-15-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to merge two sorted integer arrays to form a single sorted array. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void merge(int[], int, int[], int); - -int main() -{ - int a[] = {10, 30, 50, 70, 90}; - int b[] = {20, 40, 60, 80, 100}; - int n1 = sizeof(a) / sizeof(a[0]); - int n2 = sizeof(b) / sizeof(b[0]); - merge(a, n1, b, n2); - return 0; -} - -void merge(int a[], int n1, int b[], int n2) -{ - int n = n1 + n2; - int *c = (int *)malloc(n * sizeof(int)); - int i, j, k; - i = j = k = 0; - while (i &lt; n1 &amp;&amp; j &lt; n2) - { - if (a[i] &lt; b[j]) - { - c[k++] = a[i++]; - } - else - { - c[k++] = b[j++]; - } - } - while (i &lt; n1) - { - c[k++] = a[i++]; - } - while (j &lt; n2) - { - c[k++] = b[j++]; - } - printf(&quot;Merged Array:&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %d&quot;, c[i]); - } - free(c); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-16-c', 'assignment-s-16.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-16.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-16.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-16.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-16-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that reads 10 integers into an array (using pointers), and prints the -array in ascending and descending order. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -#define true 1 -#define false 0 - -void input_arr(int *, int); -void print(int *, int); - -int main() -{ - int arr[10]; - input_arr(arr, 10); - print(arr, 10); - return 0; -} - -void input_arr(int *arr, int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, arr + i); - } -} - -void print(int *arr, int n) -{ - int i, j, isSwaped = true, backup; - int *temp = (int *)malloc(n * sizeof(int)); - if (temp == NULL) - { - printf(&quot;\nMemory Allocation Failed.&quot;); - return; - } - for (i = 0; i &lt; n; i++) - { - *(temp + i) = *(arr + i); - } - for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) - { - isSwaped = false; - for (j = 0; j &lt; n - i - 1; j++) - { - if (*(temp + j) &gt; *(temp + j + 1)) - { - backup = *(temp + j); - *(temp + j) = *(temp + j + 1); - *(temp + j + 1) = backup; - isSwaped = true; - } - } - } - printf(&quot;\nAscending Order:&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %d&quot;, *(temp + i)); - } - printf(&quot;\nDescending Order:&quot;); - for (i = n - 1; i &gt;= 0; i--) - { - printf(&quot; %d&quot;, *(temp + i)); - } - free(temp); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-17-c', 'assignment-s-17.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-17.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-17.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-17.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-17-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to display the Fibonacci series - (i) using recursion - (ii) using iteration -*/ - -#include &lt;stdio.h&gt; - -long long int fib_rec(int); -long long int fib_tail_rec(int, long long int, long long int); -void fib_rec_print(int); -void fib_ite_print(int); - -int main() -{ - int n; - printf(&quot;Enter the number of terms: &quot;); - scanf(&quot;%d&quot;, &amp;n); - fib_rec_print(n); - fib_ite_print(n); - return 0; -} - -long long int fib_rec(int n) -{ - if (n == 0 || n == 1) - { - return n; - } - else - { - return fib_rec(n - 1) + fib_rec(n - 2); - } -} - -long long int fib_tail_rec(int n, long long int t1, long long int t2) -{ - if (n == 0) - { - return t1; - } - else if (n == 1) - { - return t2; - } - else - { - return fib_tail_rec(n - 1, t2, t1 + t2); - } -} - -void fib_rec_print(int n) -{ - int i; - printf(&quot;\nFibonacci Series (Recursion):&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %lld&quot;, fib_rec(i)); - } - printf(&quot;\nFibonacci Series (Tail-Recursion):&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %lld&quot;, fib_tail_rec(i, 0, 1)); - } -} - -void fib_ite_print(int n) -{ - int i; - long long int t1 = 0, t2 = 1, temp; - printf(&quot;\nFibonacci Series (Iteration):&quot;); - if (n &gt; 0) - { - printf(&quot; 0&quot;); - } - if (n &gt; 1) - { - printf(&quot; 1&quot;); - } - for (i = 2; i &lt; n; i++) - { - printf(&quot; %lld&quot;, t1 + t2); - temp = t1; - t1 = t2; - t2 = temp + t2; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-18-c', 'assignment-s-18.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-18.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-18.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-18.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-18-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate the factorial of a number - (i) using recursion - (ii) using iteration -*/ - -#include &lt;stdio.h&gt; - -long long int fact_tail_rec(int, long long int); -long long int fact_rec(int); -long long int fact_ite(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (n &lt; 0) - { - printf(&quot;\nFactorial of negetive number is not possible.&quot;); - return 1; - } - printf(&quot;\nFactorial of %d (Tail-Recursion) = %lld&quot;, n, fact_tail_rec(n, 1)); - printf(&quot;\nFactorial of %d (Recursion) = %lld&quot;, n, fact_rec(n)); - printf(&quot;\nFactorial of %d (Iteration) = %lld&quot;, n, fact_ite(n)); - return 0; -} - -long long int fact_tail_rec(int n, long long int result) -{ - if (n == 0 || n == 1) - { - return result; - } - else - { - return fact_tail_rec(n - 1, n * result); - } -} - -long long int fact_rec(int n) -{ - if (n == 0 || n == 1) - { - return 1; - } - else - { - return n * fact_rec(n - 1); - } -} - -long long int fact_ite(int n) -{ - int i; - long long int result = 1; - if (n == 0 || n == 1) - { - return 1; - } - for (i = 2; i &lt;= n; i++) - { - result *= i; - } - return result; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-19-c', 'assignment-s-19.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-19.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-19.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-19.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-19-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate the GCD of two numbers - (i) using recursion - (ii) without recursion -*/ - -#include &lt;stdio.h&gt; - -int gcd_tail_rec(int, int); -int gcd_rec(int, int); -int gcd_ite(int, int); - -int main() -{ - int a, b; - printf(&quot;Enter two number: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - if (a &lt; 0) - a = -a; - if (b &lt; 0) - b = -b; - printf(&quot;\nGCD (Tail-Recursion) of %d and %d is = %d&quot;, a, b, gcd_tail_rec(a, b)); - printf(&quot;\nGCD (Recursion) of %d and %d is = %d&quot;, a, b, gcd_rec(a, b)); - printf(&quot;\nGCD (Iteration) of %d and %d is = %d&quot;, a, b, gcd_ite(a, b)); - return 0; -} - -int gcd_tail_rec(int a, int b) -{ - if (b == 0) - { - return a; - } - else - { - return gcd_tail_rec(b, a % b); - } -} - -int gcd_rec(int a, int b) -{ - if (b == 0) - { - return a; - } - else - { - return gcd_rec(b, a % b); - } -} - -int gcd_ite(int a, int b) -{ - int temp; - while (b &gt; 0) - { - temp = b; - b = a % b; - a = temp; - } - return a; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-20-c', 'assignment-s-20.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-20.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-20.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-20.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-20-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a menu-driven program to perform the following matrix operations using 2-D - arrays and functions: - a. Sum - b. Difference - c. Product - d. Transpose -*/ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -#define COL_MAX 10 -#define COL_MIN 0 -#define ROW_MAX 10 -#define ROW_MIN 0 -#define TRUE 1 -#define FALSE 0 - -void input(int ***, int *, int *); -void display(int **, int, int); -void clear(int **, int); -void sum(int **, int **, int, int); -void difference(int **, int **, int, int); -void product(int **, int **, int, int, int); -void transpose(int **, int, int); - -int main() -{ - int **a = NULL, **b = NULL; - int rows_a, rows_b, cols_a, cols_b; - int choice; - - while (TRUE) - { - printf(&quot;\n === MENU ===\n&quot; - &quot;1. Sum\n&quot; - &quot;2. Difference\n&quot; - &quot;3. Product\n&quot; - &quot;4. Transpose\n&quot; - &quot;0. Exit\n&quot;); - printf(&quot;\nEnter your choice: &quot;); - scanf(&quot;%d&quot;, &amp;choice); - - switch (choice) - { - case 1: - input(&amp;a, &amp;rows_a, &amp;cols_a); - if (a == NULL) - break; - - input(&amp;b, &amp;rows_b, &amp;cols_b); - if (b == NULL) - { - clear(a, rows_a); - a = NULL; - break; - } - - printf(&quot;\nMatrix A = \n&quot;); - display(a, rows_a, cols_a); - printf(&quot;\nMatrix B = \n&quot;); - display(b, rows_b, cols_b); - - if (rows_a != rows_b || cols_a != cols_b) - { - printf(&quot;\nOrder of both matrix should be same to calculate sum.&quot;); - printf(&quot;\nInput : Matrix A = [%d x %d]&quot; - &quot; Matrix B = [%d x %d]&quot;, - rows_a, cols_a, rows_b, cols_b); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - break; - } - printf(&quot;\nResult = \n&quot;); - sum(a, b, rows_a, cols_a); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - - break; - - case 2: - input(&amp;a, &amp;rows_a, &amp;cols_a); - if (a == NULL) - break; - - input(&amp;b, &amp;rows_b, &amp;cols_b); - if (b == NULL) - { - clear(a, rows_a); - a = NULL; - break; - } - - printf(&quot;\nMatrix A = \n&quot;); - display(a, rows_a, cols_a); - printf(&quot;\nMatrix B = \n&quot;); - display(b, rows_b, cols_b); - - if (rows_a != rows_b || cols_a != cols_b) - { - printf(&quot;\nOrder of both matrix should be same to calculate difference.&quot;); - printf(&quot;\nInput : Matrix A = [%d x %d]&quot; - &quot; Matrix B = [%d x %d]&quot;, - rows_a, cols_a, rows_b, cols_b); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - break; - } - printf(&quot;\nResult = \n&quot;); - difference(a, b, rows_a, cols_a); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - - break; - - case 3: - input(&amp;a, &amp;rows_a, &amp;cols_a); - if (a == NULL) - break; - - input(&amp;b, &amp;rows_b, &amp;cols_b); - if (b == NULL) - { - clear(a, rows_a); - a = NULL; - break; - } - - printf(&quot;\nMatrix A = \n&quot;); - display(a, rows_a, cols_a); - printf(&quot;\nMatrix B = \n&quot;); - display(b, rows_b, cols_b); - - if (cols_a != rows_b) - { - printf(&quot;\nColumn count of matrix A should be same as Row count of matrix B.&quot;); - printf(&quot;\nInput : Matrix A = [%d x %d]&quot; - &quot; Matrix B = [%d x %d]&quot;, - rows_a, cols_a, rows_b, cols_b); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - break; - } - printf(&quot;\nResult = \n&quot;); - product(a, b, rows_a, cols_b, cols_a); - - clear(a, rows_a); - clear(b, rows_b); - a = NULL; - b = NULL; - - break; - - case 4: - input(&amp;a, &amp;rows_a, &amp;cols_a); - if (a == NULL) - break; - - printf(&quot;\nMatrix = \n&quot;); - display(a, rows_a, cols_a); - - printf(&quot;\nResult = \n&quot;); - transpose(a, rows_a, cols_a); - - clear(a, rows_a); - a = NULL; - - break; - - case 0: - printf(&quot;\n\nExiting program...\n&quot;); - return 0; - - default: - printf(&quot;\nInvalid choice. Please pick a choice from the menu.\n&quot;); - } - } -} - -void input(int ***matrix, int *rows, int *cols) -{ - int i, j; - printf(&quot;\nEnter row and column count (Max : 10 x 10): &quot;); - scanf(&quot;%d %d&quot;, rows, cols); - - if (*rows &gt; ROW_MAX || *cols &gt; COL_MAX || *rows &lt;= ROW_MIN || *cols &lt;= COL_MIN) - { - printf(&quot;\nInvalid dimensions. Limit is 1 to 10.\n&quot;); - *matrix = NULL; - return; - } - - *matrix = (int **)malloc(*rows * sizeof(int *)); - - for (i = 0; i &lt; *rows; i++) - { - (*matrix)[i] = (int *)malloc(*cols * sizeof(int)); - for (j = 0; j &lt; *cols; j++) - { - printf(&quot;Enter element [%d][%d]: &quot;, i + 1, j + 1); - scanf(&quot;%d&quot;, &amp;((*matrix)[i][j])); - } - } -} - -void display(int **matrix, int rows, int cols) -{ - int i, j; - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - { - printf(&quot;%d &quot;, matrix[i][j]); - } - printf(&quot;\n&quot;); - } -} - -void clear(int **matrix, int rows) -{ - int i; - for (i = 0; i &lt; rows; i++) - { - free(matrix[i]); - } - free(matrix); -} - -void sum(int **a, int **b, int rows, int cols) -{ - int i, j; - - int **r = (int **)malloc(rows * sizeof(int *)); - for (i = 0; i &lt; rows; i++) - { - r[i] = (int *)malloc(cols * sizeof(int)); - for (j = 0; j &lt; cols; j++) - { - r[i][j] = a[i][j] + b[i][j]; - } - } - display(r, rows, cols); - clear(r, rows); -} - -void difference(int **a, int **b, int rows, int cols) -{ - int i, j; - - int **r = (int **)malloc(rows * sizeof(int *)); - for (i = 0; i &lt; rows; i++) - { - r[i] = (int *)malloc(cols * sizeof(int)); - for (j = 0; j &lt; cols; j++) - { - r[i][j] = a[i][j] - b[i][j]; - } - } - display(r, rows, cols); - clear(r, rows); -} - -void product(int **a, int **b, int rows_a, int cols_b, int common) -{ - int i, x, y, z, temp; - - int **r = (int **)malloc(rows_a * sizeof(int *)); - for (i = 0; i &lt; rows_a; i++) - { - r[i] = (int *)malloc(cols_b * sizeof(int)); - } - - for (x = 0; x &lt; rows_a; x++) - { - for (y = 0; y &lt; cols_b; y++) - { - temp = 0; - for (z = 0; z &lt; common; z++) - { - temp += a[x][z] * b[z][y]; - } - r[x][y] = temp; - } - } - display(r, rows_a, cols_b); - clear(r, rows_a); -} - -void transpose(int **matrix, int rows, int cols) -{ - int i, j; - - int **r = (int **)malloc(cols * sizeof(int *)); - for (i = 0; i &lt; cols; i++) - { - r[i] = (int *)malloc(rows * sizeof(int)); - for (j = 0; j &lt; rows; j++) - { - r[i][j] = matrix[j][i]; - } - } - display(r, cols, rows); - clear(r, cols); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-21-c', 'assignment-s-21.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-21.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-21.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-21.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-21-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to copy the contents of a text file to another file, after removing all -white spaces (spaces, tabs, newlines). */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;string.h&gt; - -#define NEW_FILE_PREFIX &quot;cleaned_&quot; - -int cleaning(FILE *); - -int main() -{ - char filename[50]; - char *newFilename = NULL; - FILE *givenFile = NULL; - FILE *cleanedFile = NULL; - int len, temp; - - printf(&quot;Enter the filename (Max: 50 character): &quot;); - fgets(filename, sizeof(filename), stdin); - len = strlen(filename); - if (filename[len - 1] == &#x27;\n&#x27;) - { - filename[len - 1] = &#x27;\0&#x27;; - } - - givenFile = fopen(filename, &quot;r&quot;); - if (givenFile == NULL) - { - printf(&quot;\nCouldn&#x27;t opened the file \&quot;%s\&quot;&quot; - &quot;\nPlease ensure that \&quot;%s\&quot; is in the same folder.&quot;, - filename, filename); - return 1; - } - - len += strlen(NEW_FILE_PREFIX); - newFilename = (char *)malloc((len + 1) * sizeof(char)); - if (newFilename == NULL) - { - printf(&quot;\nMemory allocation failed.&quot;); - fclose(givenFile); - return 1; - } - newFilename[0] = &#x27;\0&#x27;; - strcat(newFilename, NEW_FILE_PREFIX); - strcat(newFilename, filename); - - cleanedFile = fopen(newFilename, &quot;w&quot;); - if (cleanedFile == NULL) - { - printf(&quot;\nCUnable to create the file \&quot;%s\&quot;&quot;, newFilename); - free(newFilename); - return 1; - } - - while ((temp = fgetc(givenFile)) != EOF) - { - if (temp != &#x27; &#x27; &amp;&amp; temp != &#x27;\n&#x27; &amp;&amp; temp != &#x27;\t&#x27;) - { - fputc(temp, cleanedFile); - } - } - - printf(&quot;\nSuccessfully cleaned: \&quot;%s\&quot;&quot;, filename); - printf(&quot;\nGenerated file: \&quot;%s\&quot;&quot;, newFilename); - - fclose(givenFile); - fclose(cleanedFile); - free(newFilename); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-22-c', 'assignment-s-22.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-22.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-22-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using structures to add two distances in meter-kilometer format. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -struct distance -{ - int km; - int m; -}; - -void total_distance(struct distance[]); - -int main() -{ - struct distance dis[2] = {0}; - printf(&quot;Enter the 1st distance (KM M): &quot;); - scanf(&quot;%d %d&quot;, &amp;dis[0].km, &amp;dis[0].m); - printf(&quot;Enter the 2nd distance: &quot;); - scanf(&quot;%d %d&quot;, &amp;dis[1].km, &amp;dis[1].m); - total_distance(dis); - return 0; -} - -void total_distance(struct distance dis[]) -{ - int result_km = dis[0].km + dis[1].km; - int result_m = dis[0].m + dis[1].m; - result_km += result_m / 1000; - result_m = result_m % 1000; - printf(&quot;Total distance: %d KM, %d M&quot;, result_km, result_m); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-23-c', 'assignment-s-23.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-23.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-23-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to add two complex numbers using structures. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -struct complex_number -{ - double real; - double imaginary; -}; - -int main() -{ - struct complex_number a, b; - printf(&quot;Enter the 1st complex number in this format (a+bi): &quot;); - scanf(&quot;%lf+%lfi&quot;, &amp;a.real, &amp;a.imaginary); - printf(&quot;Enter the 2nd complex number in this format (a+bi): &quot;); - scanf(&quot;%lf+%lfi&quot;, &amp;b.real, &amp;b.imaginary); - - printf(&quot;Result = %-2g + %-2.2g&quot;, a.real + b.real, a.imaginary + b.imaginary); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-24-c', 'assignment-s-24.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-24.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-assignment-secondary-assignment-s-24-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate the difference between two time periods using structures. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -struct time_dif -{ - int hour; - int min; - int sec; -}; - -int main() -{ - struct time_dif tpA, tpB; - long int tfA, tfB, tdif; - printf(&quot;Enter the start time in this 24 hours clock format (HH MM SS): &quot;); - scanf(&quot;%d %d %d&quot;, &amp;tpA.hour, &amp;tpA.min, &amp;tpA.sec); - printf(&quot;Enter the end time in this 24 hours clock format (HH MM SS): &quot;); - scanf(&quot;%d %d %d&quot;, &amp;tpB.hour, &amp;tpB.min, &amp;tpB.sec); - - tfA = tpA.hour * 3600 + tpA.min * 60 + tpA.sec; - tfB = tpB.hour * 3600 + tpB.min * 60 + tpB.sec; - tdif = tfB - tfA; - if (tdif &lt; 0) - { - printf(&quot;\nWrong information, End time should be later than Start time.&quot;); - return 1; - } - printf(&quot;\nTime difference: %ld Hour(s) %ld Minutes(s) %ld Second(s).&quot;, tdif / 3600, (tdif % 3600) / 60, (tdif % 3600) % 60); - - return 0; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">challenge</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-maheswar01-c', 'maheswar01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/maheswar01.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">maheswar01.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/maheswar01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-challenge-maheswar01-c" style="display:none;">#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;ctype.h&gt; -#include &lt;string.h&gt; - -#define MAX 1000 - -/* ================= STACK FOR OPERATORS ================= */ - -typedef struct { - char data[MAX]; - int top; -} CharStack; - -void initCharStack(CharStack *s) { - s-&gt;top = -1; -} - -void pushChar(CharStack *s, char c) { - s-&gt;data[++s-&gt;top] = c; -} - -char popChar(CharStack *s) { - return s-&gt;data[s-&gt;top--]; -} - -char peekChar(CharStack *s) { - return s-&gt;data[s-&gt;top]; -} - -int isEmptyChar(CharStack *s) { - return s-&gt;top == -1; -} - -/* ================= STACK FOR NUMBERS ================= */ - -typedef struct { - double data[MAX]; - int top; -} DoubleStack; - -void initDoubleStack(DoubleStack *s) { - s-&gt;top = -1; -} - -void pushDouble(DoubleStack *s, double x) { - s-&gt;data[++s-&gt;top] = x; -} - -double popDouble(DoubleStack *s) { - return s-&gt;data[s-&gt;top--]; -} - -/* ================= HELPER FUNCTIONS ================= */ - -int precedence(char op) { - if (op == &#x27;+&#x27; || op == &#x27;-&#x27;) return 1; - if (op == &#x27;*&#x27; || op == &#x27;/&#x27;) return 2; - return 0; -} - -int isOperator(char c) { - return c == &#x27;+&#x27; || c == &#x27;-&#x27; || c == &#x27;*&#x27; || c == &#x27;/&#x27;; -} - -/* ================= INFIX TO POSTFIX ================= */ - -void infixToPostfix(const char *infix, char *postfix) { - CharStack stack; - initCharStack(&amp;stack); - - int i = 0, k = 0; - - while (infix[i]) { - if (isspace(infix[i])) { - i++; - continue; - } - - if (isdigit(infix[i]) || infix[i] == &#x27;.&#x27;) { - while (isdigit(infix[i]) || infix[i] == &#x27;.&#x27;) { - postfix[k++] = infix[i++]; - } - postfix[k++] = &#x27; &#x27;; - } - else if (infix[i] == &#x27;(&#x27;) { - pushChar(&amp;stack, infix[i]); - i++; - } - else if (infix[i] == &#x27;)&#x27;) { - while (!isEmptyChar(&amp;stack) &amp;&amp; peekChar(&amp;stack) != &#x27;(&#x27;) { - postfix[k++] = popChar(&amp;stack); - postfix[k++] = &#x27; &#x27;; - } - popChar(&amp;stack); // remove &#x27;(&#x27; - i++; - } - else if (isOperator(infix[i])) { - while (!isEmptyChar(&amp;stack) &amp;&amp; - precedence(peekChar(&amp;stack)) &gt;= precedence(infix[i])) { - postfix[k++] = popChar(&amp;stack); - postfix[k++] = &#x27; &#x27;; - } - pushChar(&amp;stack, infix[i]); - i++; - } - else { - printf(&quot;Invalid character: %c\n&quot;, infix[i]); - exit(1); - } - } - - while (!isEmptyChar(&amp;stack)) { - postfix[k++] = popChar(&amp;stack); - postfix[k++] = &#x27; &#x27;; - } - - postfix[k] = &#x27;\0&#x27;; -} - -/* ================= POSTFIX EVALUATION ================= */ - -double evaluatePostfix(const char *postfix) { - DoubleStack stack; - initDoubleStack(&amp;stack); - - int i = 0; - - while (postfix[i]) { - if (isspace(postfix[i])) { - i++; - continue; - } - - if (isdigit(postfix[i]) || postfix[i] == &#x27;.&#x27;) { - char number[50]; - int k = 0; - - while (isdigit(postfix[i]) || postfix[i] == &#x27;.&#x27;) { - number[k++] = postfix[i++]; - } - number[k] = &#x27;\0&#x27;; - - pushDouble(&amp;stack, atof(number)); - } - else if (isOperator(postfix[i])) { - double b = popDouble(&amp;stack); - double a = popDouble(&amp;stack); - - switch (postfix[i]) { - case &#x27;+&#x27;: pushDouble(&amp;stack, a + b); break; - case &#x27;-&#x27;: pushDouble(&amp;stack, a - b); break; - case &#x27;*&#x27;: pushDouble(&amp;stack, a * b); break; - case &#x27;/&#x27;: - if (b == 0) { - printf(&quot;Error: Division by zero\n&quot;); - exit(1); - } - pushDouble(&amp;stack, a / b); - break; - } - i++; - } - } - - return popDouble(&amp;stack); -} - -/* ================= MAIN ================= */ - -int main() { - char infix[MAX]; - char postfix[MAX]; - - printf(&quot;Enter expression: &quot;); - fgets(infix, MAX, stdin); - - infixToPostfix(infix, postfix); - - double result = evaluatePostfix(postfix); - - printf(&quot;Result = %.10g\n&quot;, result); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-sudipto1-c', 'sudipto1.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudipto1.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">sudipto1.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudipto1.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-challenge-sudipto1-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A smart home security controller monitors the state of several sensors to decide what action to take. - * Each second, the system reads data from sensors that can either be active or inactive. Based on the current - * state of all sensors, the controller must perform exactly one action, such as activating a warning, checking - * a specific zone, or declaring an intrusion. Write a C program that reads the sensor states as input and - * prints the corresponding system action. - -- Conditions: - * 1. You must determine exactly one action for every possible combination of sensor states. - * 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). - * 3. You are not allowed to use logical operators. - * 4. You must use a single switch statement to control the program&#x27;s behaviour. - * 5. Loops may only be used for reading input, not for making decisions. - * 6. The program should handle all possible combinations of the sensors&#x27; active/inactive states and print the appropriate response each time. - -- Example (for understanding): - * If all sensors are inactive, the system should remain idle. - * If some sensors are active, the system should issue warnings or alerts based on the situation. - * If all sensors are active, the system should declare a confirmed intrusion. - */ - -/* - * This program monitors the state of four sensors (Door, Window, Motion, Glass Break) - * and determines the appropriate action without using any conditional (if, else) - * or logical (&amp;&amp;, ||) operators. - * - * It works by combining the state of all sensors into a single integer value - * using bitmasking. Each bit in the integer represents the state of one sensor - * (1 for active, 0 for inactive). This combined state is then used in a single - * switch statement to select the correct action for every possible combination. - * - * Then, enter the state of the four sensors separated by spaces, - * for example: 1 0 1 0 - */ - -/* Author - Amit Dutta, Date - 12th October, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - - // variables to hold the state of a sensor (0 or 1) - int doorSensorState, windowSensorState, motionSensorState, glassbreakSensorState; - - // variable to check the combined state of all four sensor - int combinedState = 0; - - // a invalid flag to check the input are valid or not - unsigned int invalidFlag; - - // printing the way to usage the program - printf(&quot;------ Home Security Controller ------\n&quot;); - printf(&quot;Enter sensor states (1 for active, 0 for inactive).\n&quot;); - printf(&quot;Format: [Door] [Window] [Motion] [Glass Break]\n&quot;); - printf(&quot;Example: 0 1 1 0\n&quot;); - printf(&quot;Enter states (or press Ctrl+D for MacOS or Linux / Ctrl+Z for Windows to exit): &quot;); - - // doing the main calculation - // chacking the combined state and taking a decision - while (scanf(&quot;%d %d %d %d&quot;, &amp;doorSensorState, &amp;windowSensorState, &amp;motionSensorState, &amp;glassbreakSensorState) == 4) - { - // validating input - // The expression (variable &amp; ~1) results in 0 only if &#x27;variable&#x27; is 0 or 1. - // For any other positive number, it&#x27;s non-zero. - // We combine all checks with a bitwise OR. If any sensor state is invalid, - // the flag will become non-zero. - invalidFlag = (doorSensorState &amp; ~1) | (windowSensorState &amp; ~1) | (motionSensorState &amp; ~1) | (glassbreakSensorState &amp; ~1); - - // Combine the four sensor states into a single integer using bitwise operations. - // This creates a unique number from 0 to 15 for each possible combination. - // Bit 0: Door Sensor - // Bit 1: Window Sensor - // Bit 2: Motion Sensor - // Bit 3: Glass Break Sensor - combinedState = (glassbreakSensorState &lt;&lt; 3) | (motionSensorState &lt;&lt; 2) | (windowSensorState &lt;&lt; 1) | doorSensorState; - - // If the invalid_input_flag is non-zero, we add 16 to the state. - // This pushes it outside the 0-15 range and forces the &#x27;default&#x27; case in the switch. - // We achieve this by multiplying the flag (which is &gt; 0) by 16. - combinedState += invalidFlag * 16; - - // printing the given state - printf(&quot;\n\nState : [Door : %d, Window : %d, Motion : %d, Glass Break : %d]\nState Id : %d&quot;, - doorSensorState, windowSensorState, motionSensorState, glassbreakSensorState, combinedState); - printf(&quot;\nSystem Action : &quot;); - - // taking decision based on combined state - // A single switch statement controls the program&#x27;s behavior. - // It handles all 2^4 = 16 possible combinations of sensor states, - // ensuring exactly one action is taken for every scenario. - switch (combinedState) - { - case 0: // Binary: 0000 - printf(&quot;System Idle. All sensors inactive.\n&quot;); - break; - case 1: // Binary: 0001 - printf(&quot;Check front door camera.\n&quot;); - break; - case 2: // Binary: 0010 - printf(&quot;Check window sensors.\n&quot;); - break; - case 3: // Binary: 0011 - printf(&quot;Warning: Perimeter breach suspected. Check doors and windows.\n&quot;); - break; - case 4: // Binary: 0100 - printf(&quot;Check interior cameras for movement.\n&quot;); - break; - case 5: // Binary: 0101 - printf(&quot;Warning: Potential entry and movement detected. Check front door and interior. Ask for patrol.\n&quot;); - break; - case 6: // Binary: 0110 - printf(&quot;Warning: Potential entry and movement detected. Check windows and interior. Ask for patrol.\n&quot;); - break; - case 7: // Binary: 0111 - printf(&quot;Alert: High probability of unauthorized entry. Ask for patrol.\n&quot;); - break; - case 8: // Binary: 1000 - printf(&quot;Alert: Glass break detected. High-priority event. Ask for patrol.\n&quot;); - break; - case 9: // Binary: 1001 - printf(&quot;Severe Alert: Forced entry likely (door + glass). Activate Alarm and Contact authorities.\n&quot;); - break; - case 10: // Binary: 1010 - printf(&quot;Severe Alert: Forced entry likely (window + glass). Activate Alarm and Contact authorities.\n&quot;); - break; - case 11: // Binary: 1011 - printf(&quot;Intrusion Alert: Multiple perimeter breaches. Activate Alarm and Contact authorities.\n&quot;); - break; - case 12: // Binary: 1100 - printf(&quot;Intrusion Alert: Confirmed interior presence after breach. Activate Alarm and Contact authorities.\n&quot;); - break; - case 13: // Binary: 1101 - printf(&quot;INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n&quot;); - break; - case 14: // Binary: 1110 - printf(&quot;INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n&quot;); - break; - case 15: // Binary: 1111 - printf(&quot;CATASTROPHIC EVENT! ALL SENSORS TRIGGERED. ACTIVATE ALARM AND CONTACT COPS.\n&quot;); - break; - default: - // This case should not be reached with valid 0/1 input but is included for completeness. - printf(&quot;Error: Invalid sensor state detected.\n&quot;); - break; - } - - // discarding extra characters (if any) left - while (getchar() != &#x27;\n&#x27;) - ; - - // asking for next set of input - printf(&quot;\nEnter next set of states: &quot;); - } - printf(&quot;\nSecurity system shutting down.\n&quot;); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-sudiptoown01-c', 'sudiptoown01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudiptoown01.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">sudiptoown01.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudiptoown01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-challenge-sudiptoown01-c" style="display:none;">/* - * A smart home security controller monitors the state of several sensors to decide what action to take. - * Each second, the system reads data from sensors that are either an active or inactive. Based on the current - * state of all sensors, the controller must perform exactly one action, such as activating a warning, checking - * a specific zone, or declaring an intrusion. Write a C program that reads the sensor status as input and - * prints the corresponding system action. - * Hints: - * 1. The most determinative action wins for every possible combination of sensor states. - * 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). - * 3. You are not allowed to use logical operators. - * 4. You must use a single switch statement to control the program&#x27;s behavior. - * 5. The program should handle all possible combinations of the sensors&#x27; active/inactive states and print the appropriate response each time. - * 6. All sensors are inactive, the system should remain idle. - * 7. If some sensors are active, the system should issue warnings or alerts based on the situation. - * 8. If all sensors are active, the system should declare a confirmed intrusion. - * Solution: - * We can solve this problem simply by assigning each case its own distinct integer. - * There are 2 possibilities for a sensor and therefore there are 2^4 = 16 cases. - * Using arrays we can assign each case its own index value and print it as per the encoded binary integer. - */ -#include &lt;stdio.h&gt; - -int casekey(int door, int window, int motion, int glass) { - int key = (door &lt;&lt; 3) | (window &lt;&lt; 2) | (motion &lt;&lt; 1) | glass; - return key; -} - -int main() { - int door, window, motion, glass, key; - char choice; - - static const char *action[16] = { - &quot;IDLE&quot;, &quot;CHECK WINDOW&quot;, &quot;WARN MOTION&quot;, &quot;WARN MOTION WINDOW&quot;, - &quot;CHECK DOOR&quot;, &quot;WARN DOOR WINDOW&quot;, &quot;INTRUSION SUSPECTED&quot;, &quot;INTRUSION CONFIRMED&quot;, - &quot;GLASS ONLY&quot;, &quot;DOOR GLASS&quot;, &quot;MOTION GLASS&quot;, &quot;MOTION WINDOW GLASS&quot;, - &quot;DOOR WINDOW&quot;, &quot;DOOR WINDOW GLASS&quot;, &quot;DOOR MOTION GLASS&quot;, &quot;ALL SENSORS&quot; - }; - - do { - printf(&quot;Sensors: Door, Window, Motion, Glass\n&quot;); - printf(&quot;Enter the state of each sensor in binary (0 or 1): &quot;); - scanf(&quot;%d %d %d %d&quot;, &amp;door, &amp;window, &amp;motion, &amp;glass); - - key = casekey(door, window, motion, glass); - printf(&quot;Action: %s\n&quot;, action[key]); - - printf(&quot;Want to continue? (y/n): &quot;); - scanf(&quot; %c&quot;, &amp;choice); - printf(&quot;\n&quot;); - } while (choice == &#x27;y&#x27; || choice == &#x27;Y&#x27;); - - return 0; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">internal-practice</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-01-c', 'IP-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-01.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-01.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-01-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to compute the sum and product of digits of an integer using user -defined functions. */ - -#include &lt;stdio.h&gt; - -int sum_of_digits(int); -int product_of_digits(int); - -int main() -{ - int num; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;num); - printf(&quot;\nSum of digits of %d = %d&quot;, num, sum_of_digits(num)); - printf(&quot;\nProduct of digits of %d = %d&quot;, num, product_of_digits(num)); - return 0; -} - -int sum_of_digits(int num) -{ - int sum = 0; - while (num &gt; 0) - { - sum += num % 10; - num /= 10; - } - return sum; -} - -int product_of_digits(int num) -{ - int product = 1; - while (num &gt; 0) - { - product *= num % 10; - num /= 10; - } - return product; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-02-c', 'IP-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-02.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-02.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-02-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to reverse a non-negative integer using a function. */ - -#include &lt;stdio.h&gt; - -int reverse(int); - -int main() -{ - int num; - printf(&quot;Enter a non-negetive integer: &quot;); - scanf(&quot;%d&quot;, &amp;num); - if (num &lt; 0) - { - printf(&quot;\nOnly non-negetive integers are allowed.&quot;); - return 1; - } - printf(&quot;\nReverse of the integer %d = %d&quot;, num, reverse(num)); - return 0; -} - -int reverse(int num) -{ - int rev = 0; - while (num &gt; 0) - { - rev = (rev * 10) + (num % 10); - num /= 10; - } - return rev; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-03-c', 'IP-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-03.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-03.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-03-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to compute the sum of the first n terms of the series using a function: -S=1−2+3−4+5−6+… */ - -#include &lt;stdio.h&gt; - -int sum_of_series(int); - -int main() -{ - int n; - printf(&quot;Enter the n: &quot;); - scanf(&quot;%d&quot;, &amp;n); - printf(&quot;\nSum of the first %d terms of the series = %d&quot;, n, sum_of_series(n)); - return 0; -} - -int sum_of_series(int n) -{ - int sum = 0; - int i; - for (i = 1; i &lt;= n; i++) - { - if (i % 2 == 0) - { - sum -= i; - } - else - { - sum += i; - } - } - return sum; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-04-c', 'IP-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-04.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-04.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-04-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function to check whether a number is prime or not. Use the same function to -generate all prime numbers less than 100. */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int isPrime(int); - -int main() -{ - int n, i; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (isPrime(n)) - { - printf(&quot;\nInput %d is a Prime Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is not a Prime Number.&quot;, n); - } - printf(&quot;\nPrime Numbers less than 100:&quot;); - for (i = 1; i &lt; 100; i++) - { - if (isPrime(i)) - { - printf(&quot; %d&quot;, i); - } - } - return 0; -} - -int isPrime(int n) -{ - if (n &lt;= 1) - return 0; - if (n == 2) - return 1; - if (n % 2 == 0) - return 0; - - int temp = (int)sqrt(n); - int i; - for (i = 3; i &lt;= temp; i += 2) - { - if (n % i == 0) - { - return 0; - } - } - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-05-c', 'IP-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-05.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-05.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-05-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function to check whether a given string is a palindrome. Use this function to -determine whether an entered string is Palindrome. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -int isPalindrome(char[]); - -int main() -{ - char input[100]; - int len; - - printf(&quot;Enter the string (Max: 100 Character): &quot;); - fgets(input, sizeof(input), stdin); - len = strlen(input); - - if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) - { - input[len - 1] = &#x27;\0&#x27;; - } - - if (isPalindrome(input)) - { - printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); - } - else - { - printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); - } - - return 0; -} - -int isPalindrome(char str[]) -{ - char *start = str; - char *end; - int len = strlen(str); - - if (len == 0) - { - return 1; - } - - end = str + (len - 1); - - while (start &lt; end) - { - if (*start != *end) - { - return 0; - } - start++; - end--; - } - - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-06-c', 'IP-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-06.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-06.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-06-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using a function to compute and display all factors of a given number. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void display_factors(int); - -int main() -{ - int num, i; - printf(&quot;Please enter the number to get the factors from it : &quot;); - scanf(&quot;%d&quot;, &amp;num); - display_factors(num); - return 0; -} - -void display_factors(int num) { - int temp = abs(num); - int i; - - if (temp == 0) - { - printf(&quot;\n0 has infinitely many factors (all integers).&quot;); - exit(1); - } - - printf(&quot;\nThe factors of &#x27; %d &#x27; is :- &quot;, num); - printf(&quot;\nPositive : &quot;); - for (i = 1; i &lt;= temp; i++) - if (temp % i == 0) - printf(&quot; %d&quot;, i); - printf(&quot;\nNegative : &quot;); - for (i = 1; i &lt;= temp; i++) - if (temp % i == 0) - printf(&quot; %d&quot;, -i); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-07-c', 'IP-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-07.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-07.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-07-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to swap two numbers using pointers (user-defined function). */ - -#include &lt;stdio.h&gt; - -void swap(int *, int *); - -int main() -{ - int a, b; - printf(&quot;Enter value for a and b: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - printf(&quot;\nBefore Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - swap(&amp;a, &amp;b); - printf(&quot;\nAfter Swap: &quot;); - printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); - printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); - return 0; -} - -void swap(int *a, int *b) -{ - *a = *a ^ *b; - *b = *a ^ *b; - *a = *a ^ *b; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-08-c', 'IP-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-08.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-08.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-08-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that takes the radius of a circle as input, passes it to a function that -computes area and circumference, and displays results in main(). */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -void area_circumference(double, double *, double *); - -int main() -{ - double r, area, circumference; - printf(&quot;Enter the radius of the circle: &quot;); - scanf(&quot;%lf&quot;, &amp;r); - area_circumference(r, &amp;area, &amp;circumference); - printf(&quot;\nArea of the circle = %g&quot;, area); - printf(&quot;\nCircumference of the circle = %g&quot;, circumference); - return 0; -} - -void area_circumference(double r, double *area, double *circumference) -{ - *area = M_PI * r * r; - *circumference = 2 * M_PI * r; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-09-c', 'IP-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-09.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-09.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-09-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the sum of n elements entered by the user. Use dynamic -memory allocation (malloc() or calloc()). */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputarr(int[], int); -int sum_elem(int[], int); - -int main() -{ - int n, *arr; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;n); - arr = (int *)malloc(n * sizeof(int)); - inputarr(arr, n); - printf(&quot;\nSum of the %d element(s) = %d&quot;, n, sum_elem(arr, n)); - free(arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int sum_elem(int arr[], int n) -{ - int i, sum = 0; - for (i = 0; i &lt; n; i++) - { - sum += arr[i]; - } - return sum; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-10-c', 'IP-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-10.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-10.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-10-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function that reverses the elements of an array in place, using only a single -pointer argument, and return void. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputArray(int[], int); -void printArray(int[], int); -void reverse(int *); - -int main() -{ - int n, i, *arr = NULL; - printf(&quot;Enter the number of element: &quot;); - scanf(&quot;%d&quot;, &amp;n); - arr = (int *)malloc(n * sizeof(int)); - if (arr == NULL) - { - printf(&quot;\nMemory allocation failed.&quot;); - return 1; - } - inputArray(arr, n); - printf(&quot;\nGiven Array: &quot;); - printArray(arr, n); - for (i = 0; i &lt; n; i++) - { - reverse(&amp;arr[i]); - } - printf(&quot;\nUpdated Array: &quot;); - printArray(arr, n); - free(arr); - return 0; -} - -void inputArray(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -void printArray(int arr[], int n) -{ - int i; - printf(&quot;[&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i &lt; n - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]&quot;); -} - -void reverse(int *n) -{ - int temp = *n; - int rev = 0; - while (temp &gt; 0) - { - rev = (rev * 10) + (temp % 10); - temp /= 10; - } - *n = rev; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-11-c', 'IP-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-11.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-11.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-11-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to merge two sorted integer arrays to form a single sorted array. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void merge(int[], int, int[], int); - -int main() -{ - int a[] = {10, 30, 50, 70, 90}; - int b[] = {20, 40, 60, 80, 100}; - int n1 = sizeof(a) / sizeof(a[0]); - int n2 = sizeof(b) / sizeof(b[0]); - merge(a, n1, b, n2); - return 0; -} - -void merge(int a[], int n1, int b[], int n2) -{ - int n = n1 + n2; - int *c = (int *)malloc(n * sizeof(int)); - int i, j, k; - i = j = k = 0; - while (i &lt; n1 &amp;&amp; j &lt; n2) - { - if (a[i] &lt; b[j]) - { - c[k++] = a[i++]; - } - else - { - c[k++] = b[j++]; - } - } - while (i &lt; n1) - { - c[k++] = a[i++]; - } - while (j &lt; n2) - { - c[k++] = b[j++]; - } - printf(&quot;Merged Array:&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %d&quot;, c[i]); - } - free(c); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-12-c', 'IP-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-12.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-12.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-12-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that reads 10 integers into an array (using pointers), and prints the -array in ascending and descending order. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -#define true 1 -#define false 0 - -void input_arr(int *, int); -void print(int *, int); - -int main() -{ - int arr[10]; - input_arr(arr, 10); - print(arr, 10); - return 0; -} - -void input_arr(int *arr, int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, arr + i); - } -} - -void print(int *arr, int n) -{ - int i, j, isSwaped = true, backup; - int *temp = (int *)malloc(n * sizeof(int)); - if (temp == NULL) - { - printf(&quot;\nMemory Allocation Failed.&quot;); - return; - } - for (i = 0; i &lt; n; i++) - { - *(temp + i) = *(arr + i); - } - for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) - { - isSwaped = false; - for (j = 0; j &lt; n - i - 1; j++) - { - if (*(temp + j) &gt; *(temp + j + 1)) - { - backup = *(temp + j); - *(temp + j) = *(temp + j + 1); - *(temp + j + 1) = backup; - isSwaped = true; - } - } - } - printf(&quot;\nAscending Order:&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %d&quot;, *(temp + i)); - } - printf(&quot;\nDescending Order:&quot;); - for (i = n - 1; i &gt;= 0; i--) - { - printf(&quot; %d&quot;, *(temp + i)); - } - free(temp); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-13-c', 'IP-13.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-13.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-13.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-13.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-13-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to display the Fibonacci series - (i) using recursion - (ii) using iteration -*/ - -#include &lt;stdio.h&gt; - -long long int fib_rec(int); -long long int fib_tail_rec(int, long long int, long long int); -void fib_rec_print(int); -void fib_ite_print(int); - -int main() -{ - int n; - printf(&quot;Enter the number of terms: &quot;); - scanf(&quot;%d&quot;, &amp;n); - fib_rec_print(n); - fib_ite_print(n); - return 0; -} - -long long int fib_rec(int n) -{ - if (n == 0 || n == 1) - { - return n; - } - else - { - return fib_rec(n - 1) + fib_rec(n - 2); - } -} - -long long int fib_tail_rec(int n, long long int t1, long long int t2) -{ - if (n == 0) - { - return t1; - } - else if (n == 1) - { - return t2; - } - else - { - return fib_tail_rec(n - 1, t2, t1 + t2); - } -} - -void fib_rec_print(int n) -{ - int i; - printf(&quot;\nFibonacci Series (Recursion):&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %lld&quot;, fib_rec(i)); - } - printf(&quot;\nFibonacci Series (Tail-Recursion):&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %lld&quot;, fib_tail_rec(i, 0, 1)); - } -} - -void fib_ite_print(int n) -{ - int i; - long long int t1 = 0, t2 = 1, temp; - printf(&quot;\nFibonacci Series (Iteration):&quot;); - if (n &gt; 0) - { - printf(&quot; 0&quot;); - } - if (n &gt; 1) - { - printf(&quot; 1&quot;); - } - for (i = 2; i &lt; n; i++) - { - printf(&quot; %lld&quot;, t1 + t2); - temp = t1; - t1 = t2; - t2 = temp + t2; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-14-c', 'IP-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-14.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-14.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-14-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate the factorial of a number - (i) using recursion - (ii) using iteration -*/ - -#include &lt;stdio.h&gt; - -long long int fact_tail_rec(int, long long int); -long long int fact_rec(int); -long long int fact_ite(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (n &lt; 0) - { - printf(&quot;\nFactorial of negetive number is not possible.&quot;); - return 1; - } - printf(&quot;\nFactorial of %d (Tail-Recursion) = %lld&quot;, n, fact_tail_rec(n, 1)); - printf(&quot;\nFactorial of %d (Recursion) = %lld&quot;, n, fact_rec(n)); - printf(&quot;\nFactorial of %d (Iteration) = %lld&quot;, n, fact_ite(n)); - return 0; -} - -long long int fact_tail_rec(int n, long long int result) -{ - if (n == 0 || n == 1) - { - return result; - } - else - { - return fact_tail_rec(n - 1, n * result); - } -} - -long long int fact_rec(int n) -{ - if (n == 0 || n == 1) - { - return 1; - } - else - { - return n * fact_rec(n - 1); - } -} - -long long int fact_ite(int n) -{ - int i; - long long int result = 1; - if (n == 0 || n == 1) - { - return 1; - } - for (i = 2; i &lt;= n; i++) - { - result *= i; - } - return result; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-15-c', 'IP-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-15.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-15.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-15-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate the GCD of two numbers - (i) using recursion - (ii) without recursion -*/ - -#include &lt;stdio.h&gt; - -int gcd_tail_rec(int, int); -int gcd_rec(int, int); -int gcd_ite(int, int); - -int main() -{ - int a, b; - printf(&quot;Enter two number: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - if (a &lt; 0) - a = -a; - if (b &lt; 0) - b = -b; - printf(&quot;\nGCD (Tail-Recursion) of %d and %d is = %d&quot;, a, b, gcd_tail_rec(a, b)); - printf(&quot;\nGCD (Recursion) of %d and %d is = %d&quot;, a, b, gcd_rec(a, b)); - printf(&quot;\nGCD (Iteration) of %d and %d is = %d&quot;, a, b, gcd_ite(a, b)); - return 0; -} - -int gcd_tail_rec(int a, int b) -{ - if (b == 0) - { - return a; - } - else - { - return gcd_tail_rec(b, a % b); - } -} - -int gcd_rec(int a, int b) -{ - if (b == 0) - { - return a; - } - else - { - return gcd_rec(b, a % b); - } -} - -int gcd_ite(int a, int b) -{ - int temp; - while (b &gt; 0) - { - temp = b; - b = a % b; - a = temp; - } - return a; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-16-c', 'IP-16.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-16.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-16.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-16.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-16-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named isArmstrong with the -signature int isArmstrong(int num);. An Armstrong number is a number that is equal to -the sum of its own digits each raised to the power of the number of digits. For example, -153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int isArmstrong(int); -int count(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - - if (isArmstrong(n)) - { - printf(&quot;\nInput %d is a Armstrong Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is Not a Armstrong Number.&quot;, n); - } - - return 0; -} - -int count(int n) -{ - int count = 0; - while (n &gt; 0) - { - count++; - n = n / 10; - } - return count; -} - -int isArmstrong(int n) -{ - if (n &lt; 0) - return 0; - if (n == 0) - return 1; - - int power = count(n); - int temp = n; - int checker = 0; - - while (temp &gt; 0) - { - int digit = temp % 10; - checker = checker + (int)round(pow(digit, power)); - temp = temp / 10; - } - return n == checker; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-17-c', 'IP-17.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-17.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-17.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-17.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-17-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named isPerfect with the signature -int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of -its proper divisors, excluding itself. For example, 28 is a perfect number because the sum -of its divisors (1, 2, 4, 7, 14) equals 28. */ - -#include &lt;stdio.h&gt; - -int isPerfect(int); - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (isPerfect(n)) - { - printf(&quot;\nInput %d is a Perfect Number.&quot;, n); - } - else - { - printf(&quot;\nInput %d is not a Perfect Number.&quot;, n); - } - return 0; -} - -int isPerfect(int n) -{ - if (n &lt;= 1) - return 0; - int temp = 1; - int i; - for (i = 2; i &lt;= n / 2; i++) - { - if (n % i == 0) - { - temp += i; - } - } - return temp == n; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-18-c', 'IP-18.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-18.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-18.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-18.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-18-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named findLargest with the -signature int findLargest(int arr[], int size);. The function should take an array of integers -and its size, and return the largest element in the array. */ - -#include &lt;stdio.h&gt; - -void inputArray(int[], int); -int findLargest(int[], int); - -int main() -{ - int size; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - inputArray(arr, size); - printf(&quot;\nLargest Element is: %d&quot;, findLargest(arr, size)); - return 0; -} - -void inputArray(int arr[], int size) -{ - int i; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int findLargest(int arr[], int size) -{ - int largest = arr[0], i; - for (i = 1; i &lt; size; i++) - { - if (largest &lt; arr[i]) - { - largest = arr[i]; - } - } - return largest; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-19-c', 'IP-19.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-19.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-19.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-19.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-19-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that includes a user-defined function named binarySearch with the -signature int binarySearch(int arr[], int size, int target);. The function should perform a -binary search on a sorted array of integers and return the index of the target element if -found, and -1 otherwise. */ - -#include &lt;stdio.h&gt; - -int inputArray(int[], int); -// void sortArray(int[], int); -int binarySearch(int[], int, int); - -int main() -{ - int size; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - int target = inputArray(arr, size); - // sortArray(arr, size); // If needed - int index = binarySearch(arr, size, target); - if (index != -1) - { - printf(&quot;\nElement %d is found at index %d.&quot;, target, index); - } - else - { - printf(&quot;\nElement %d is not found.&quot;, target); - } - return 0; -} - -int inputArray(int arr[], int size) -{ - int i, target; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element for position %d: &quot;, i); - scanf(&quot;%d&quot;, &amp;arr[i]); - } - printf(&quot;\nEnter the target element: &quot;); - scanf(&quot;%d&quot;, &amp;target); - return target; -} - -/* void sortArray(int arr[], int size) -{ - // using Bubble Sort... - - int tempArr[size], i, j, temp; - printf(&quot;\nBefore Sorting:\n[&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i != size - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]\n&quot;); - for (i = 0; i &lt; size - 1; i++) - { - for (j = 0; j &lt; size - i - 1; j++) - { - if (arr[j] &gt; arr[j + 1]) - { - temp = arr[j]; - arr[j] = arr[j + 1]; - arr[j + 1] = temp; - } - } - } - printf(&quot;\nAfter Sorting:\n[&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i != size - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]\n&quot;); -} -*/ - -int binarySearch(int arr[], int size, int target) -{ - int low = 0; - int high = size - 1; - int mid; - while (low &lt;= high) - { - mid = low + ((high - low) / 2); - if (arr[mid] == target) - { - return mid; - } - else if (arr[mid] &gt; target) - { - high = mid - 1; - } - else if (arr[mid] &lt; target) - { - low = mid + 1; - } - } - return -1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-20-c', 'IP-20.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-20.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-20.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-20.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-internal-practice-IP-20-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that defines an array of integers, and includes a user-defined function -named reverseArray with the signature void reverseArray(int arr[], int size);. The function -should reverse the elements of the array. */ - -#include &lt;stdio.h&gt; - -void inputArray(int[], int); -void reverseArray(int[], int); - -int main() -{ - int size; - printf(&quot;How many element do you want to add: &quot;); - scanf(&quot;%d&quot;, &amp;size); - int arr[size]; - inputArray(arr, size); - reverseArray(arr, size); - return 0; -} - -void inputArray(int arr[], int size) -{ - int i; - for (i = 0; i &lt; size; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -void reverseArray(int arr[], int size) -{ - int i, j, temp; - printf(&quot;\nBefore Reverse: \n&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); - } - for (i = 0, j = size - 1; i &lt; j; i++, j--) - { - temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - printf(&quot;\nAfter Reverse: \n&quot;); - for (i = 0; i &lt; size; i++) - { - printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); - } -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">khurapati-idea</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI001-c', 'KI001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-khurapati-idea-KI001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -// khurapati idea no. : 1 -// Idea : we can use the side effect of printf function to get length of any string or number -// Author - Amit Dutta, Date - 16-10-2025 - -#include &lt;stdio.h&gt; -int main() -{ - // testing number - int num, len = -13 /* here minus 13 because we will remove the massage characters in line 10 */; - printf(&quot;Enter a number to get the length : &quot;); - scanf(&quot;%d&quot;, &amp;num); - len += printf(&quot;Your input : %d&quot;, num); // here the &quot;Your input : &quot;, this 13 characters are extra - printf(&quot;\nLength : %d&quot;, len); - - // testing char - char a[20]; - len = -13; - while (getchar() != &#x27;\n&#x27;) - ; - printf(&quot;\nEnter a word to get the length : &quot;); - scanf(&quot;%19s&quot;, &amp;a); - len += printf(&quot;Your input : %s&quot;, a); // here the &quot;Your input : &quot;, this 13 characters are extra - printf(&quot;\nLength : %d&quot;, len); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI002-c', 'KI002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-khurapati-idea-KI002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Author - Amit Dutta, Date - 05th November, 2025 */ - -/* Plan - checking for edge case */ - -#include &lt;stdio.h&gt; -int main() -{ - printf(&quot;Starting.....\n&quot;); - - for (int i = 1; ; i++) - { - printf(&quot;i = %d\n&quot;, i); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI003-c', 'KI003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-khurapati-idea-KI003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Bubble sort (with swap) */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;stdbool.h&gt; - -void inputarr(int **, int); -void display(int[], int); -int asort(int *, int); -int dsort(int *, int); - -int main() -{ - int *arr = NULL, n, choice; - do - { - printf(&quot;\nEnter element count: &quot;); - if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) - { - printf(&quot;\nERROR: Invalid element count!!! Try again...&quot;); - } - else - { - break; - } - } while (true); - inputarr(&amp;arr, n); - - while (true) - { - printf(&quot;\n1. Sort in Ascending Order.&quot; - &quot;\n2. Sort in Descending Order&quot; - &quot;\n3. Change Input&quot; - &quot;\n0. Exit&quot; - &quot;\nYour choice: &quot;); - do - { - if (scanf(&quot;%d&quot;, &amp;choice) != 1) - { - printf(&quot;\nInvalid Choice!!! Try again...&quot;); - while (getchar() != &#x27;\n&#x27;) - ; - } - else - { - break; - } - } while (true); - - switch (choice) - { - case 1: - printf(&quot;\n === Selected Mode: Ascending Order ===\n&quot;); - if (!asort(arr, n)) - { - printf(&quot;\nElements are already sorted.\n&quot;); - display(arr, n); - } - printf(&quot;\n&quot;); - break; - case 2: - printf(&quot;\n === Selected Mode: Descending Order ===\n&quot;); - if (!dsort(arr, n)) - { - printf(&quot;\nElements are already sorted.\n&quot;); - display(arr, n); - } - printf(&quot;\n&quot;); - break; - case 3: - do - { - printf(&quot;\nEnter element count: &quot;); - if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) - { - printf(&quot;\nERROR: Invalid element count!!! Try again...&quot;); - } - else - { - break; - } - } while (true); - free(arr); - inputarr(&amp;arr, n); - break; - case 0: - printf(&quot;\nExiting Program...\n&quot;); - free(arr); - return 0; - default: - printf(&quot;\nInvalid Choice!!! Try again...&quot;); - } - } -} - -void inputarr(int **arr, int n) -{ - int i; - if (n &lt; 1) - { - printf(&quot;\nInvalid element number.&quot;); - return; - } - *arr = (int *)malloc(n * sizeof(int)); - if (*arr == NULL) - { - printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); - exit(1); - } - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter Element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;((*arr)[i])); - } -} - -void display(int arr[], int n) -{ - int i; - printf(&quot;[&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot;%d&quot;, arr[i]); - if (i != n - 1) - { - printf(&quot;, &quot;); - } - } - printf(&quot;]&quot;); -} - -int asort(int *arr, int n) -{ - bool isSwaped = true; - int i, j, tempNum, swapCount = 0; - int *temp = (int *)malloc(n * sizeof(int)); - if (temp == NULL) - { - printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); - free(arr); - exit(1); - } - for (i = 0; i &lt; n; i++) - { - temp[i] = *(arr + i); - } - for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) - { - isSwaped = false; - for (j = 0; j &lt; n - i - 1; j++) - { - if (temp[j] &gt; temp[j + 1]) - { - tempNum = temp[j]; - temp[j] = temp[j + 1]; - temp[j + 1] = tempNum; - isSwaped = true; - swapCount++; - } - } - } - if (swapCount &gt; 0) - { - display(temp, n); - } - free(temp); - return swapCount; -} - -int dsort(int *arr, int n) -{ - bool isSwaped = true; - int i, j, tempNum, swapCount = 0; - int *temp = (int *)malloc(n * sizeof(int)); - if (temp == NULL) - { - printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); - free(arr); - exit(1); - } - for (i = 0; i &lt; n; i++) - { - temp[i] = *(arr + i); - } - for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) - { - isSwaped = false; - for (j = 0; j &lt; n - i - 1; j++) - { - if (temp[j] &lt; temp[j + 1]) - { - tempNum = temp[j]; - temp[j] = temp[j + 1]; - temp[j + 1] = tempNum; - isSwaped = true; - swapCount++; - } - } - } - if (swapCount &gt; 0) - { - display(temp, n); - } - free(temp); - return swapCount; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">letusc</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc001-c', 'luc001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Temperature of a city in fahrenheit degrees is input through -the keyboard. WAP to convert this temperature into Centigrade -degrees. */ -/* Author - Amit Dutta, Date - 13 sep, 2025 */ -/* Chapter 1; Page 19; Question NO.: F(a) */ - -#include&lt;stdio.h&gt; -int main() { - float f, c; - printf(&quot;Enter the temperature of city in Fahrenheit : &quot;); - scanf(&quot;%f&quot;, &amp;f); - // formula (F - 32) 5/9 - c = ((f - 32) * 5) / 9; - printf(&quot;\nTemperature in centigrade : %f&quot;, c); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc002-c', 'luc002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* The length and breadth of a rectangle and radius of a circle -are input through the keyboard. Write a program to calculate the -area and perimeter of the rectangle, and the area and circumference -of the circle. */ -/* Author - Amit Dutta, Date - 16th SEP, 2025 */ -/* Let Us C; Page - 19; Chap- 1; QNo.: F(b) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double len, bre, r, area_r, per, area_c, cir; - printf(&quot;Enter the length and breadth of the rectangle : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;len, &amp;bre); - printf(&quot;Enter the Radius of the circle : &quot;); - scanf(&quot;%lf&quot;, &amp;r); - area_r = len * bre; - per = 2 * (len + bre); - area_c = M_PI * r * r; - cir = 2 * M_PI * r; - printf(&quot;\nArea of Rectangle : %lf&quot; - &quot;\nPerimeter of Rectangle : %lf&quot; - &quot;\nArea of Circle : %lf&quot; - &quot;\nCircumference of Circle : %lf&quot;, - area_r, per, area_c, cir); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc003-c', 'luc003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Paper of size AO has dimensions 1189 mm x 841 mm. -Each subsequent size A(n) is defined as A(n-1) cut in -half, parallel to its shorter sides. Thus, paper of -size A1 would have dimensions 841 mm x 594 mm. Write -a program to calculate and print paper sizes A0,� -A1,�A2,�...�A8. */ -/* Author - Amit Dutta, Date - 16th SEP, 2025 */ -/* Let Us C; Page - 19; Chap- 1; QNo.: F(c) */ - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double s_long = 1189.0, s_short = 841.0, temp; - int i; - printf(&quot;A0 Dimension : %g mm x %g mm&quot;, floor(s_long), floor(s_short)); - for (i = 1; i &lt;= 8; i++) { - temp = s_long; - s_long = s_short; - s_short = temp / 2; - printf(&quot;\nA%d Dimension : %g mm x %g mm&quot;, i, floor(s_long), floor(s_short)); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc004-c', 'luc004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If a five digit number is input through the keyboard, -write a program to calculate the sum of it&#x27;s digit. -(Hint : Use the modulus operator %) */ -/* Author - Amit Dutta, Date - 28th SEP, 2025 */ -/* Let Us C; Page - 37; Chap- 2; QNo.: G(a) */ - -#include &lt;stdio.h&gt; -int main() -{ - int inp, result = 0, i, temp; - printf(&quot;Enter a five digit number : &quot;); - scanf(&quot;%d&quot;, &amp;inp); - if (inp &lt; 10000 || inp &gt; 99999) - { - printf(&quot;\nPlease enter a valid five digit number.&quot;); - return 1; - } - temp = inp; - for (i = 1; i &lt;= 5; i++) - { - result = result + (inp % 10); - inp = inp / 10; - } - printf(&quot;\nSum of the digit &#x27;%d&#x27; is : %d&quot;, temp, result); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc005-c', 'luc005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to recive Cartesian -co-ordinates (x, y) of a point and convert -them into Polar co-ordinates (r, phi) - Hint : r = sqrt (x^2 + y^2) and phi = tan^-1 (y/x) */ -/* Author - Amit Dutta, Date - 28th SEP, 2025 */ -/* Let Us C; Page - 37; Chap- 2; QNo.: G(b) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double x, y, r, phi; - printf(&quot;Enter the Cartesian Co-Ordinates in this format &#x27;x, y&#x27; : &quot;); - scanf(&quot;%lf, %lf&quot;, &amp;x, &amp;y); - r = sqrt(pow(x, 2) + pow(y, 2)); - phi = atan2(y, x); - printf(&quot;\nPolar Co-Ordinates are : (%g, %g Rad)&quot;, r, phi); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc006-c', 'luc006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to receive values of latitude (L1, L2) and longitude -(G1, G2), in degrees, of two places on the earth and output the distance -(D) between them in nautical miles. The formula for distance in nautical -miles is : - D = 3963 cos^-1(sin L1 sin L2 + cos L1 cos L2 * cos(G2 - G1)) -*/ -/* Author - Amit Dutta, Date - 29th SEP, 2025 */ -/* Let Us C, Chap - 2, Page - 37, Qn no.: G(c) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double l1, l2, g1, g2, d; - printf(&quot;Enter the Latitude in &#x27;L1, L2&#x27; format : &quot;); - scanf(&quot;%lf, %lf&quot;, &amp;l1, &amp;l2); - printf(&quot;Enter the Longitude in &#x27;G1, G2&#x27; format : &quot;); - scanf(&quot;%lf, %lf&quot;, &amp;g1, &amp;g2); - // Converting degree to radian because function from math.h use radian not degree - l1 = l1 * (M_PI / 180); - l2 = l2 * (M_PI / 180); - g1 = g1 * (M_PI / 180); - g2 = g2 * (M_PI / 180); - d = 3963 * acos(sin(l1) * sin(l2) + cos(l1) * cos(l2) * cos(g2 - g1)); - printf(&quot;Distance in nautical miles : %g&quot;, d); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc007-c', 'luc007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Wind-chill factor is the felt air temperature on exposed skin due to wind. -The wind-chill temperature is always lower than the air temperature, and is -calculated as per the following formula. - wcf = 35.74 + 0.6215t + (0.4275t - 35.75) * v^0.16 -Where t is temperature and v is wind velocity. Write a program to receive -values of t and v and calcualate wind-chill factor (wcf). */ -/* Author - Amit Dutta, Date - 30th SEP, 2025 */ -/* Let Us C, Chap - 2, Page - 37, Qn No.: G(d) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double t, v, wcf; - printf(&quot;Enter the temperature and velociy of the wind : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;t, &amp;v); - wcf = 35.74 + (0.6215 * t) + (((0.4275 * t) - 35.75) * pow(v, 0.16)); - printf(&quot;\nWind-chill factor (wcf) : %g&quot;, wcf); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc008-c', 'luc008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If value of an angle is input through the keyboard, -write a program to print all its trigonometric ratios. */ -/* Author - Amit Dutta, Date - 30th SEP, 2025 */ -/* Let Us C, Chap - 2, Page - 37, Qn No.: G(e) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double inp, rsin, rcos, rtan, rcosec, rsec, rcot; - printf(&quot;Enter the Angle in degree : &quot;); - scanf(&quot;%lf&quot;, &amp;inp); - inp = inp * (M_PI / 180); //changing degree to radian - rsin = sin(inp); - rcos = cos(inp); - rtan = tan(inp); - rcosec = 1 / rsin; - rsec = 1 / rcos; - rcot = 1 / rtan; - printf(&quot;\nTrigonometric ratios :-&quot; - &quot;\nsin = %g &quot; - &quot;\ncos = %g&quot; - &quot;\ntan = %g&quot; - &quot;\ncosec = %g&quot; - &quot;\nsec = %g&quot; - &quot;\ncot = %g&quot;, - rsin, rcos, rtan, rcosec, rsec, rcot); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc009-c', 'luc009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Two numbers are input through the keyboard into two locations -C and D. Write a program to interchange the contents of C and D. */ -/* Author - Amit Dutta, Date - 30th SEP, 2025 */ -/* Let Us C, Chap - 2, Page - 37, Qn No.: G(d) */ - -#include &lt;stdio.h&gt; -int main() -{ - double a, b; - printf(&quot;Enter the two number A and B : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;a, &amp;b); - printf(&quot;\nBefore Interchange : &quot;); - printf(&quot;\nA = %g (Memory location = %p)&quot;, a, &amp;a); - printf(&quot;\nB = %g (Memory location = %p)&quot;, b, &amp;b); - a = a + b; - b = a - b; - a = a - b; - printf(&quot;\nAfter Interchange :&quot;); - printf(&quot;\nA = %g (Memory location = %p)&quot;, a, &amp;a); - printf(&quot;\nB = %g (Memory location = %p)&quot;, b, &amp;b); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc010-c', 'luc010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A five-digit number is entered through the keyboard. Write a program -to obtain the reversed number and to etermine whether the original and reversed -numbers are equal or not. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap - 3, Page - 53, Qn No.: f(a) */ - -#include &lt;stdio.h&gt; -int main() -{ - int num, rev, temp, i; - printf(&quot;Please enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - if (num &lt; 10000 || num &gt; 99999) - { - printf(&quot;\nPlease enter a five digit number.&quot;); - return 1; - } - temp = num; - for (i = 1; i &lt;= 5; i++) - { - rev = (rev * 10) + num % 10; - num = num / 10; - } - printf(&quot;\nReverse of the Input number : %d&quot;, rev); - if (rev == temp) - printf(&quot;\nOriginal and reversed numbers are equal.&quot;); - else - printf(&quot;\nOrigianl and reversed numbers are not equal.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc011-c', 'luc011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If ages of Ram, Shyam and Ajay are input through the keyboard, -write a program to determine the youngest of the three. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(b) */ - -#include &lt;stdio.h&gt; -int main() -{ - int ram, shyam, ajay; - printf(&quot;Please enter the age of Ram, Shyam and Ajay : &quot;); - scanf(&quot;%d %d %d&quot;, &amp;ram, &amp;shyam, &amp;ajay); - if (ram == shyam || ram == ajay || shyam == ajay) - printf(&quot;\nThree must have different age.&quot;); - if (ram &lt; shyam &amp;&amp; ram &lt; ajay) - printf(&quot;\nRam is the youngest. Age : %d&quot;, ram); - if (shyam &lt; ram &amp;&amp; shyam &lt; ajay) - printf(&quot;\nShyam is the youngest. Age : %d&quot;, shyam); - if (ajay &lt; ram &amp;&amp; ajay &lt; shyam) - printf(&quot;\nAjay is the youngest. Age : %d&quot;, ajay); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc012-c', 'luc012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check whether a triangle is valid or not, -if three angles of the triangle are entered through the keyboard. -A triangle is valid if the sum of all the three angles is equal to 180 degrees. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(c) */ - -#include &lt;stdio.h&gt; -int main() -{ - double angle1, angle2, angle3, sum; - printf(&quot;Enter the value of the three angle of the triangle : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;angle1, &amp;angle2, &amp;angle3); - sum = angle1 + angle2 + angle3; - if (sum == 180.0) - printf(&quot;\nThis Triangle is a valid one.&quot;); - else - printf(&quot;\nThis Triangle is not valid. Sum of the angles : %g&quot;, sum); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc013-c', 'luc013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc013.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc013.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc013-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the absolute value -of a number entered through the keyboard. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(d) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double num; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%lf&quot;, &amp;num); - num = abs(num); - printf(&quot;\nAbsolute value of the input is : %g&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc014-c', 'luc014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc014.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc014.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc014-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Given the length and breadth of a rectangle, write a program to find -whether the area of the rectangle is greater than it&#x27;s perimeter. -For example, the area of the rectangle with length = 5 and breadth = 4 -is greater than its perimeter. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(e) */ - -#include &lt;stdio.h&gt; -int main() -{ - double len, bre, area, peri; - printf(&quot;Enter the length and breadth of the rectangle : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;len, &amp;bre); - area = len * bre; - peri = 2 * (len + bre); - if (area &gt; peri) - printf(&quot;\nThe area of the rectangle is greater than it&#x27;s perimeter.&quot;); - else if (area &lt; peri) - printf(&quot;\nThe area of the rectangle is lower than it&#x27;s perimeter.&quot;); - else - printf(&quot;\nThe area of the rectangle is same as it&#x27;s perimeter.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc015-c', 'luc015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc015.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc015.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc015-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Given three points (x1, y1), (x2, y2), and (x3, y3), -write a program to check if the three poins fall on one straight line. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(f) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#define EPSILON 0.0001 -// Define a small tolerance value (EPSILON) for safe floating-point comparison -// This is critical because of minor rounding errors in computer arithmetic. -int main() -{ - double x1, x2, x3, y1, y2, y3, area; - printf(&quot;Enter the point A(x1, y1) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;x1, &amp;y1); - printf(&quot;Enter the point B(x2, y2) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;x2, &amp;y2); - printf(&quot;Enter the point C(x3, y3) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;x3, &amp;y3); - area = 0.5 * ((x1 * (y2 - y3)) + (x2 * (y3 - y1)) + (x3 * (y1 - y2))); - if (fabs(area) &lt; EPSILON) // abs() for integer, fabs() for float, double - printf(&quot;\nA(%g, %g), B(%g, %g) and C(%g, %g) points fall on one straight line.&quot;, x1, y1, x2, y2, x3, y3); - else - printf(&quot;\nA(%g, %g), B(%g, %g) and C(%g, %g) points doesn&#x27;t fall on one straight line.&quot;, x1, y1, x2, y2, x3, y3); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc016-c', 'luc016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc016.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc016.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc016-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Given the coordiantes (x, y) of center of a circle and its radius, -write a program that will determine whether a point lies inside the circle, -on the circle or outside the circle. (Hint : Use sqrt() and pow() functions.) */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(g) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -// Define a small tolerance value (EPSILON) for reliable floating-point comparison -#define EPSILON 0.0001 - -int main() -{ - double h, k; - double R; - double x, y; - double distance_sq; - printf(&quot;Enter the center coordinates (h, k) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;h, &amp;k); - printf(&quot;Enter the radius (R) : &quot;); - scanf(&quot;%lf&quot;, &amp;R); - printf(&quot;Enter the point P coordinates (x, y) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;x, &amp;y); - distance_sq = pow(x - h, 2) + pow(y - k, 2); - double radius_sq = R * R; - // Case 1: On the circle (D^2 = R^2) - Use EPSILON for safety! - if (fabs(distance_sq - radius_sq) &lt; EPSILON) - { - printf(&quot;The point P(%g, %g) lies ON THE CIRCLE.\n&quot;, x, y); - } - // Case 2: Inside the circle (D^2 &lt; R^2) - else if (distance_sq &lt; radius_sq) - { - printf(&quot;The point P(%g, %g) lies INSIDE THE CIRCLE.\n&quot;, x, y); - } - // Case 3: Outside the circle (D^2 &gt; R^2) - else - { - printf(&quot;The point P(%g, %g) lies OUTSIDE THE CIRCLE.\n&quot;, x, y); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc017-c', 'luc017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc017.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc017.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc017-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Given a point (x, y), write a program to find out if it lies on X-axis, Y-axis or origin. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(h) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#define EPSILON 0.00001 - -int main() -{ - double x, y; - printf(&quot;Enter the point P(x, y) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;x, &amp;y); - if (fabs(x) &lt; EPSILON &amp;&amp; fabs(y) &lt; EPSILON) - printf(&quot;\nPoint P(%g, %g) lies on the origin.&quot;, x, y); - else if (fabs(x) &lt; EPSILON) - printf(&quot;\nPoint P(%g, %g) lies on the Y-Axis.&quot;, x, y); - else if (fabs(y) &lt; EPSILON) - printf(&quot;\nPoint P(%G, %g) lies on the X-Axis.&quot;, x, y); - else - printf(&quot;\nThe point P(%g, %g) lies in a QUADRANT (not on an axis or the origin).&quot;, x, y); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc018-logic-c', 'luc018-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018-logic.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc018-logic.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc018-logic-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* According to Gregorian calender, it was Monday on the date 01/01/01. -Write a program to find out what is the day on 1st January of any input year. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(i) */ - -#include &lt;stdio.h&gt; - -/** - * @brief Determines if a given year is a leap year. - * * The rule: A year is a leap year if it is divisible by 4, UNLESS it is - * divisible by 100 but NOT by 400. - * * @param year The year to check. - * @return 1 if it is a leap year, 0 otherwise. - */ -int is_leap(int year) { - // Check if divisible by 400 OR (divisible by 4 AND not divisible by 100) - if ((year % 400 == 0) || (year % 4 == 0 &amp;&amp; year % 100 != 0)) { - return 1; - } - return 0; -} - -/** - * @brief Calculates the day of the week for January 1st of the given year. - * * The base date is 01/01/01, which was a Monday (index 1). - * * Day Mapping: 0:Sunday, 1:Monday, 2:Tuesday, 3:Wednesday, 4:Thursday, 5:Friday, 6:Saturday - */ -int main() { - long long year; // Use long long for year input if years far in the future/past are tested - int i; - long long total_days = 0; - int day_index; - - // Day names array for output - const char *day_names[] = {&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}; - - printf(&quot;Enter the year (e.g., 2025): &quot;); - if (scanf(&quot;%lld&quot;, &amp;year) != 1 || year &lt; 1) { - printf(&quot;Invalid year input. Please enter a positive integer year (&gt;= 1).\n&quot;); - return 1; - } - - // --- Core Logic: Calculate Total Days --- - - // We only need to consider the years that have *passed* before the target year. - // So, we count days from the end of year 0 up to the end of year (year - 1). - int years_passed = year - 1; - - // 1. Calculate the number of leap days up to the end of year (year - 1) - // Formula based on Gregorian calendar rules for years Y-1: - // (Y-1)/4 - (Y-1)/100 + (Y-1)/400 - long long leap_years = years_passed / 4 - years_passed / 100 + years_passed / 400; - - // 2. Total days = (Number of years * 365) + (Number of leap years) - // Note: The loop method (below) is more intuitive but the formula is faster. - // We will use the direct formula for efficiency. - total_days = years_passed * 365 + leap_years; - - // --- Alternate Loop Method (for conceptual simplicity) --- - /* - for (i = 1; i &lt; year; i++) { - total_days += 365; - if (is_leap(i)) { - total_days += 1; // Add 1 for the leap day - } - } - */ - - // --- Determine the Day of the Week --- - - // Since 01/01/01 was Monday (index 1), we use the following setup: - // Index 1 corresponds to Monday. - // The calculation gives the number of days *past* the Monday start (01/01/01). - // The modulo operation gives the remainder (0-6). - - // 0 days elapsed (Year 1): total_days=0. (0 + 1) % 7 = 1 (Monday). Correct. - // 365 days elapsed (Year 2): total_days=365. (365 + 1) % 7 = 2 (Tuesday). Correct. (365 mod 7 = 1, 1+1 = 2) - - day_index = (total_days + 1) % 7; - - // Correct the Day Index to match the array (0:Sun, 1:Mon, ..., 6:Sat) - // The +1 adjusts for the Monday starting point (index 1). - - printf(&quot;\nOn January 1st, %lld, the day was: **%s**.\n&quot;, year, day_names[day_index]); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc018-c', 'luc018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc018.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc018-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* According to Gregorian calender, it was Monday on the date 01/01/01. -if any year is input through the keyboard write a program to find out -what is the day on 1st January of this year. */ -/* Author - Amit Dutta, Date - 1st OCT, 2025 */ -/* Let Us C, Chap- 3, Page - 53, Qn No.: f(i) */ - -#include &lt;stdio.h&gt; - -int is_leap(int year) { - if ((year % 400 == 0) || (year % 4 == 0 &amp;&amp; year % 100 != 0)) { - return 1; - } - return 0; -} - -int main() { - long long year; // long long for year input if years far in the future/past are tested - int i; - long long total_days = 0; - int day_index; - - // Day names array for output - const char *day_names[] = {&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}; - - printf(&quot;Enter the year (e.g., 2025): &quot;); - if (scanf(&quot;%lld&quot;, &amp;year) != 1 || year &lt; 1) { - printf(&quot;Invalid year input. Please enter a positive integer year (&gt;= 1).\n&quot;); - return 1; - } - int years_passed = year - 1; - long long leap_years = years_passed / 4 - years_passed / 100 + years_passed / 400; - total_days = years_passed * 365 + leap_years; - day_index = (total_days + 1) % 7; - printf(&quot;\nOn January 1st, %lld, the day was: %s.\n&quot;, year, day_names[day_index]); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc019-c', 'luc019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc019.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc019.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc019-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If the length of three sides of a triangle are entered through the -keyboard, write a program to check whether the triangle is an isosceles, -an equilateral, a scalene or a right-angled triangle. */ -/* Author - Amit Dutta, Date - 3rd OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 71, Qn No.: D(a) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -#define EPSILON 0.000001 -/* EPSILON is used to compare double values for approximate equality, -mitigating floating-point precision errors. */ - -int main() -{ - double side1, side2, side3; - printf(&quot;Please enter the length of three side of the triangle : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;side1, &amp;side2, &amp;side3); - if (side1 &lt; 1 || side2 &lt; 1 || side3 &lt; 1) - { - printf(&quot;\nLength of a side of triangle should be a positive integer.&quot;); - return 1; - } - if (side1 + side2 &lt; side3 || side1 + side3 &lt; side2 || side2 + side3 &lt; side1) - { - printf(&quot;\nEntered triangle is not VALID.&quot;); - return 1; - } - // isosceles check - if (side1 == side2 || side2 == side3 || side3 == side1) - printf(&quot;\nEntered triangle is a ISOSCELES triangle.&quot;); - else - printf(&quot;\nEntered triangle is NOT a ISOSCELES triangle.&quot;); - // equilateral check - if (side1 == side2 &amp;&amp; side2 == side3) - printf(&quot;\nEntered triangle is a EQUILATERAL triangle.&quot;); - else - printf(&quot;\nEntered triangle is NOT a EQUILATERAL triangle.&quot;); - // scalene check - if (side1 != side2 &amp;&amp; side2 != side3) - printf(&quot;\nEntered triangle is a SCALENE triangle.&quot;); - else - printf(&quot;\nEntered triangle is NOT a SCALENE triangle.&quot;); - // right-angle check - if (fabs(((side1 * side1) + (side2 * side2)) - (side3 * side3)) &lt; EPSILON || - fabs(((side2 * side2) + (side3 * side3)) - (side1 * side1)) &lt; EPSILON || - fabs(((side3 * side3) + (side1 * side1)) - (side2 * side2)) &lt; EPSILON) - printf(&quot;\nEntered triangle is a RIGHT-ANGLED triangle.&quot;); - else - printf(&quot;\nEntered triangle is NOT a RIGHT-ANGLED triangle.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc020-c', 'luc020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc020.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc020.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc020-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* In digital world colors are specified in Red-Green-Blue (RGB) format, -with values of R, G, B varying on an integer scale from 0 to 255. In print -publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, -with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. -Write a program that converts RGB color to CMYK color as per the following formulae: - White = Max(Red/255, Green/255, Blue/255) - Cyan = (White-Red/255) / White - Magenta = (White-Green/255) / White - Yellow = (White-Blue/255) / White - Black = 1 - White -Note that if the RGB values are all 0, then the CMY values are all 0 and the K value is 1. */ -/* Author - Amit Dutta, Date - 4th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 71, Qn No.: D(b) */ - -#include &lt;stdio.h&gt; - -// declaring function -double get_white(double red, double green, double blue) -{ - double max; - max = red / 255; - if (max &lt; (green / 255)) - max = green / 255; - if (max &lt; (blue / 255)) - max = blue / 255; - return max; -} - -int main() -{ - double r, g, b, w, c = 0, m = 0, y = 0, k = 0; - printf(&quot;Enter the RGB color code in &#x27;R G B&#x27; format : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;r, &amp;g, &amp;b); - - // checking for invalid input (negetive input) - if (r &lt; 0 || g &lt; 0 || b &lt; 0) - { - printf(&quot;\nRGB color code can not be a negetive number.&quot;); - return 1; - } - - // checking for invalid input (out of range color code) - if (r &gt; 255 || g &gt; 255 || b &gt; 255) - { - printf(&quot;\nRGB color code can be maximum (255, 255, 255).&quot;); - return 1; - } - - // converting RGB color code to CMYK color code - if (r == 0 &amp;&amp; g == 0 &amp;&amp; b == 0) - k = 1; - else - { - w = get_white(r, g, b); - c = (w - (r / 255)) / w; - m = (w - (g / 255)) / w; - y = (w - (b / 255)) / w; - k = 1 - w; - } - - printf(&quot;\nRGB color (%g, %g, %g) equivalent to CMYK color (%g, %g, %g, %g).&quot;, r, g, b, c, m, y, k); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc021-c', 'luc021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc021.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc021.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc021-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A certain grade of steel is graded according to the following conditions: - (i) Hardness must be greater than 50 - (ii) Carbon content must be less than 0.7 - (iii) Tensile strength must be greater than 5600 - -The grades are as follows: - Grade is 10 if all three conditions are met - Grade is 9 if conditions (i) and (ii) are met - Grade is 8 if conditions (ii) and (iii) are met - Grade is 7 if conditions (i) and (iii) are met - Grade is 6 if only one condition is met - Grade is 5 if none of the conditions are met - -Write a program, which will require the user to give values of hardness, -carbon content and tensile strength of the steel under consideration and output -the grade of the steel. */ - -/* Author - Amit Dutta, Date - 4th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 71, Qn No.: D(c) */ - -#include &lt;stdio.h&gt; -int main() -{ - double hardness, carbon_content, tensile_strength; - printf(&quot;Enter the details of the steel below - \n&quot;); - printf(&quot;1. Hardness : &quot;); - scanf(&quot;%lf&quot;, &amp;hardness); - printf(&quot;2. Carbon Content : &quot;); - scanf(&quot;%lf&quot;, &amp;carbon_content); - printf(&quot;3. Tensile Strength : &quot;); - scanf(&quot;%lf&quot;, &amp;tensile_strength); - - // storing how many conditions are met as boolean result - int condition_met, condition1, condition2, condition3; - condition1 = hardness &gt; 50; - condition2 = carbon_content &lt; 0.7; - condition3 = tensile_strength &gt; 5600; - condition_met = condition1 + condition2 + condition3; - - // now grading according the result - int grade; - if (condition_met == 3) - grade = 10; - else if (condition_met == 2) - { - if (condition1 &amp;&amp; condition2) - grade = 9; - else if (condition2 &amp;&amp; condition3) - grade = 8; - else if (condition1 &amp;&amp; condition3) - grade = 7; - } - else if (condition_met == 1) - grade = 6; - else - grade = 5; - - // printing the result - printf(&quot;\n------------- Result -------------&quot;); - printf(&quot;\n1. Hardness : Condition %s&quot;, condition1 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); - printf(&quot;\n2. Carbon Content : Condition %s&quot;, condition2 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); - printf(&quot;\n3. Tensile Strength : Condition %s&quot;, condition3 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); - printf(&quot;\nTotal Condition Met : %d&quot;, condition_met); - printf(&quot;\n\nGrade : %d\n\n&quot;, grade); - return 0; -} - -/* I did not used this long variable names. I used very short just the first letter of the word. -After writting the whole program, I just renamed the valiables. This is possible in Visual Stdio Code. */</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc022-c', 'luc022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc022.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc022.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc022-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* The Body Mass Index (BMI) is defined as ratio of weight of the -person (in Kilograms) to square of the height (in meters). -Write a program that receives weight and height, calculate the BMI, and reports -the BMI catagory as per the following table. - BMI Catagory BMI - Starvation &lt; 15 - Anorexic 15.1 to 17.5 - Underweight 17.6 to 18.5 - Ideal 18.6 to 24.9 - Overweight 25 to 25.9 - Obese 30 to 39.9 - Morbidly Obese &gt;= 40 -*/ -/* Author - Amit Dutta, Date - 4th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 72, Qn No.: D(d) */ - -#include &lt;stdio.h&gt; - -int main() -{ - double weight, height, bmi; - printf(&quot;Enter your Weight (in Kilograms) and Height (in Meters) : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;weight, &amp;height); - bmi = weight / (height * height); - printf(&quot;\nCalculated BMI : %g&quot;, bmi); - if (bmi &lt; 15) - printf(&quot;\nBMI Catagory : Starvation&quot;); - else if (bmi &gt;= 15.1 &amp;&amp; bmi &lt;= 17.5) - printf(&quot;\nBMI Catagory : Anorexic&quot;); - else if (bmi &gt;= 17.6 &amp;&amp; bmi &lt;= 18.5) - printf(&quot;\nBMI Catagory : Underweight&quot;); - else if (bmi &gt;= 18.6 &amp;&amp; bmi &lt;= 24.9) - printf(&quot;\nBMI Catagory : Ideal&quot;); - else if (bmi &gt;= 25 &amp;&amp; bmi &lt;= 25.9) - printf(&quot;\nBMI Catagory : Overweight&quot;); - else if (bmi &gt;= 30 &amp;&amp; bmi &lt;= 39.9) - printf(&quot;\nBMI Catagory : Obese&quot;); - else if (bmi &gt;= 40) - printf(&quot;\nBMI Catagory : Morbidly Obese&quot;); - else - printf(&quot;\nBMI Catagory : Unclassified&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc023-c', 'luc023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc023.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc023.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc023-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Using conditional operators determine : - (1) Whether the character entered through the keyboard is a - lower case alphabet or not. - (2) Whether a character entered through the keyboard is a special - symbol or not. */ -/* Author - Amit Dutta, Date - 5th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 72, Qn No.: E(a) */ - -#include &lt;stdio.h&gt; -int main() -{ - char inp; - printf(&quot;Enter the character : &quot;); - scanf(&quot;%c&quot;, &amp;inp); - printf(&quot;\nInput Character &#x27;%c&#x27; is %s a LOWER CASE ALPHABET.&quot;, inp, - (inp &gt;= &#x27;a&#x27; &amp;&amp; inp &lt;= &#x27;z&#x27;) ? &quot;&quot; : &quot;NOT&quot;); - printf(&quot;\nInput Character &#x27;%c&#x27; is %s a SPECIAL SYMBOL.&quot;, inp, - (inp &gt;= &#x27;a&#x27; &amp;&amp; inp &lt;= &#x27;z&#x27; || inp &gt;= &#x27;A&#x27; &amp;&amp; inp &lt;= &#x27;Z&#x27; - || inp &gt;= &#x27;0&#x27; &amp;&amp; inp &lt;= &#x27;9&#x27;) ? &quot;NOT&quot; : &quot;&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc024-c', 'luc024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc024.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc024.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc024-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using conditional operators to determine whether -a year entered through the keyboard is a leap year or not. */ -/* Author - Amit Dutta, Date - 5th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 72, Qn No.: E(b) */ - -#include &lt;stdio.h&gt; -int main() -{ - int year; - printf(&quot;Enter the year : &quot;); - scanf(&quot;%d&quot;, &amp;year); - printf(&quot;\nYear %d is %s a Leapyear.&quot;, year, (year % 400 == 0 || year % 4 == 0 &amp;&amp; year % 100 != 0) ? &quot;&quot; : &quot;NOT&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc025-c', 'luc025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc025.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc025.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc025-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the greates of the three numbers entered -through the keyboard. Use conditional operators. */ -/* Author - Amit Dutta, Date - 6th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 72, Qn No.: E(c) */ - -#include &lt;stdio.h&gt; -int main() -{ - double num1, num2, num3, max; - printf(&quot;Enter three number : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;num1, &amp;num2, &amp;num3); - printf(&quot;\nGreatest of the three number &#x27;%g&#x27;, &#x27;%g&#x27; and &#x27;%g&#x27; is : &#x27;%g&#x27;&quot;, num1, num2, num3, - (num1 &gt; num2 &amp;&amp; num1 &gt; num3) ? num1 : ((num2 &gt; num1 &amp;&amp; num2 &gt; num3) ? num2 : num3)); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc026-c', 'luc026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc026.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc026.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc026-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to recieve value of an angle in degreesand check -whether sum of squares of sine and cosine of this angle is equal to 1. */ -/* Author - Amit Dutta, Date - 6th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 73, Qn No.: E(d) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#define EPSILON 0.0000001 - -int main() -{ - double angle, result; - printf(&quot;Enter the angle value in degree : &quot;); - // checking if the input is other than number. - if(scanf(&quot;%lf&quot;, &amp;angle) != 1) { - printf(&quot;\nPlease enter a number.&quot;); - return 1; - } - angle = angle * (M_PI / 180); // converting degree to radian - result = pow(sin(angle), 2) + pow(cos(angle), 2); - (fabs(result - 1.0) &lt; EPSILON) ? - printf(&quot;\nsum of squares of sine and cosine of this angle is equal to 1.&quot;) : - printf(&quot;\nsum of squares of sine and cosine of this angle is NOT equal to 1.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc027-c', 'luc027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc027.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc027.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc027-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Rewrite the folowing program using conditional operations - #include&lt;stdio.h&gt; - int main() - { - float sal; - printf(&quot;Enter the salary&quot;); - scanf(&quot;%f&quot;, &amp;sal); - if(sal &gt;= 25000 &amp;&amp; sal &lt;= 40000) - printf(&quot;Manager\n&quot;); - else - if(sal &gt;= 15000 &amp;&amp; sal &lt; 25000) - printf(&quot;Accountant\n&quot;); - else - printf(&quot;Clerk\n&quot;); - return 0; - } -*/ -/* Author - Amit Dutta, Date - 6th OCT, 2025 */ -/* Let Us C, Chap- 4, Page - 73, Qn No.: E(e) */ - -#include &lt;stdio.h&gt; -int main() -{ - float sal; - printf(&quot;Enter the salary&quot;); - scanf(&quot;%f&quot;, &amp;sal); - (sal &gt;= 25000 &amp;&amp; sal &lt;= 40000) ? printf(&quot;Manager\n&quot;) : - ((sal &gt;= 15000 &amp;&amp; sal &lt; 25000) ? printf(&quot;Accountant\n&quot;) : printf(&quot;Clerk\n&quot;)); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc028-c', 'luc028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc028.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc028.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc028-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print all the ASCII values and their equivalent -characters using a while loop. The ASCII may vary from 0 to 255. */ -/* Author - Amit Dutta, Date - 7th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(a) */ - -#include &lt;stdio.h&gt; -int main() -{ - int i = 0; - printf(&quot;ASCII Value\tCharacter&quot;); - printf(&quot;\n-----------\t---------\n&quot;); - while (i &lt;= 255) - { - printf(&quot;%d.\t%c\n\n&quot;, i, i); - i++; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc029-c', 'luc029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc029.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc029.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc029-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print out all Armstrong numbers between 100 -and 500. If sum of cubes of each digit of the number is equal to the -number itself, then the number is called an Armstrong number. For -example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3) */ -/* Author - Amit Dutta, Date - 7th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(b) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - int num = 100, temp1, temp2, res; - printf(&quot;Armstrong numbers between 100 and 500 :&quot;); - while (num &lt;= 500) - { - temp1 = num; - res = 0; - while (temp1 != 0) - { - temp2 = temp1 % 10; - res = res + pow(temp2, 3); - temp1 = temp1 / 10; - } - if (num == res) - printf(&quot; %d&quot;, num); - num++; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc030-c', 'luc030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc030.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc030.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc030-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program for a matchstick game being played between the -computer and a user. Your program should ensure that the computer -always wins. Rules for the game are as follows : - - There are 21 matchsticks. - - The computer asks the player to pick 1, 2, 3, or 4 matchsticks. - - After the person picks, the computer does its picking. - - Whoever is forced to pick up the last matchstick loses the game. -*/ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(c) */ - -/* My Plan: The total number of matchsticks is 21. To guarantee a win, -the computer ensures that after its turn, the number of remaining -matchsticks is always a multiple of 5 plus 1 (i.e., 16, 11, 6, 1). -This is achieved by making the sum of the player&#x27;s pick and the -computer&#x27;s pick equal to 5 in each round. This forces the player -to pick the final matchstick. */ - -#include &lt;stdio.h&gt; -int main() -{ - int remaining_matchsticks = 21, player_pick, computer_pick; - printf(&quot; --- Matchstick Game ---\n&quot;); - printf(&quot;Rules: There are 21 matchsticks. You can pick 1, 2, 3, or 4.\n&quot;); - printf(&quot;Whoever is forced to pick the last matchstick loses the game.\n&quot;); - while (remaining_matchsticks &gt; 1) - { - // game start - printf(&quot;\n--------------------------&quot;); - printf(&quot;\nRemaining Matchsticks : %d&quot;, remaining_matchsticks); - - // player pick and checking input is valid or not - printf(&quot;\nYour turn: Pick 1, 2, 3, or 4 matchsticks: &quot;); - if (scanf(&quot;%d&quot;, &amp;player_pick) != 1) - { - printf(&quot;\n\tPlease enter a number.&quot;); - while (getchar() != &#x27;\n&#x27;) - ; - continue; - } - - // checking player pick is valid or not - if (player_pick &lt; 1 || player_pick &gt; 4) - { - printf(&quot;\n\tPlease enter a number among 1, 2, 3 and 4.&quot;); - while (getchar() != &#x27;\n&#x27;) - ; - continue; - } - - if (player_pick &gt; remaining_matchsticks) - { - printf(&quot;\nInvalid choice! There are not enough matchsticks left.&quot;); - while (getchar() != &#x27;\n&#x27;) - ; - continue; - } - - // computer_picks - computer_pick = 5 - player_pick; - printf(&quot;\ncomputer_picks : %d&quot;, computer_pick); - - // remaining matchsticks - remaining_matchsticks = remaining_matchsticks - (player_pick + computer_pick); - } - - // game over - printf(&quot;\n----------------------------------\n&quot;); - printf(&quot;Only 1 matchstick is left.\n&quot;); - printf(&quot;You are forced to pick the last matchstick. You lose!\n&quot;); - printf(&quot;The computer wins.\n&quot;); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc031-logic-c', 'luc031-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031-logic.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc031-logic.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc031-logic-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to enter numbers till the user wants. At the end it -should display the count of positive, negative and zeros entered. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(d) */ - -/* - * DETAILED PROGRAM PLAN: - * 1. INITIALIZATION: Set three counters (positive_count, negative_count, zero_count) to zero. - * 2. INPUT LOOP: Start an infinite loop to continuously request user input. - * 3. READ INPUT: Use fgets() to read the user&#x27;s input as a generic string (char array). - * This allows the program to accept multi-digit numbers (e.g., &quot;-500&quot;) or the command (&#x27;n&#x27;). - * 4. TERMINATION CHECK: Immediately check if the input string is exactly &quot;n&quot; using strcmp(). - * If true, the user wants to quit, so break the loop. - * 5. VALIDATION &amp; CONVERSION: If the input is not &quot;n&quot;, use sscanf() to safely attempt to convert - * the string into an integer. - * 6. COUNTING LOGIC: If sscanf() successfully reads an integer (sscanf returns 1): - * - If the number is &gt; 0, increment positive_count. - * - If the number is &lt; 0, increment negative_count. - * - If the number is == 0, increment zero_count. - * 7. ERROR HANDLING: If the input is neither &quot;n&quot; nor a valid number (sscanf returns 0), - * inform the user of invalid input and continue the loop. - * 8. FINAL DISPLAY: After the loop terminates, print the final totals for positive, negative, and zero counts. - */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; // for strtol -#include &lt;string.h&gt; // for strcmp - -// Maximum size of the input line -#define MAX_INPUT_LEN 15 - -int main() { - // Initialize counters - int positive_count = 0; - int negative_count = 0; - int zero_count = 0; - - // Buffer to store the user&#x27;s input as a string (e.g., &quot;123&quot;, &quot;-50&quot;, or &quot;n&quot;) - char input_buffer[MAX_INPUT_LEN]; - int number; - - printf(&quot;--- Number Analyzer ---\n&quot;); - printf(&quot;Enter numbers one by one. Type &#x27;n&#x27; and press Enter to finish.\n\n&quot;); - - // Loop until the user enters &#x27;n&#x27; - while (1) { - printf(&quot;Enter number or &#x27;n&#x27;: &quot;); - - // Read the entire line of input into the buffer - if (fgets(input_buffer, MAX_INPUT_LEN, stdin) == NULL) { - // Handle EOF (end of file) or reading error - break; - } - - // Remove the trailing newline character from the input_buffer - // The last character will be &#x27;\n&#x27; if the input was shorter than MAX_INPUT_LEN - size_t len = strlen(input_buffer); - if (len &gt; 0 &amp;&amp; input_buffer[len - 1] == &#x27;\n&#x27;) { - input_buffer[len - 1] = &#x27;\0&#x27;; - } - - // 1. Check for the termination condition - if (strcmp(input_buffer, &quot;n&quot;) == 0) { - printf(&quot;\n&#x27;n&#x27; received. Stopping input...\n&quot;); - break; // Exit the while loop - } - - // 2. Attempt to convert the input string to an integer - // sscanf attempts to read the string according to the format &quot;%d&quot; (decimal integer) - // It returns 1 if a number was successfully read. - int conversions = sscanf(input_buffer, &quot;%d&quot;, &amp;number); - - if (conversions == 1) { - // Conversion was successful, now check the number&#x27;s sign - if (number &gt; 0) { - positive_count++; - } else if (number &lt; 0) { - negative_count++; - } else { - zero_count++; - } - printf(&quot; -&gt; Number recorded: %d\n&quot;, number); - } else { - // Conversion failed. The input was neither &#x27;n&#x27; nor a valid integer. - printf(&quot; -&gt; Invalid input. Please enter a valid number or &#x27;n&#x27;.\n&quot;); - } - } - - // Display the final results - printf(&quot;\n====================================\n&quot;); - printf(&quot; Analysis Complete\n&quot;); - printf(&quot;====================================\n&quot;); - printf(&quot;Positive numbers entered: %d\n&quot;, positive_count); - printf(&quot;Negative numbers entered: %d\n&quot;, negative_count); - printf(&quot;Zeroes entered: %d\n&quot;, zero_count); - printf(&quot;Total numbers recorded: %d\n&quot;, positive_count + negative_count + zero_count); - printf(&quot;====================================\n&quot;); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc031-c', 'luc031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc031.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc031-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to enter numbers till the user wants. At the end it -should display the count of positive, negative and zeros entered. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(d) */ - -#include &lt;stdio.h&gt; -int main() -{ - int choice = 1, num, positive_count = 0, negative_count = 0, zero_count = 0; - while (choice == 1) - { - printf(&quot;\nEnter the number (Type any character and press Enter to finish.) : &quot;); - choice = scanf(&quot;%d&quot;, &amp;num); // Checking whether the user has input any characters - if (choice == 1) - { - printf(&quot;Number recorded : %d&quot;, num); - if (num &lt; 0) - negative_count++; - else if (num &gt; 0) - positive_count++; - else if (num == 0) - zero_count++; - } - else - { - // If the user inputs any characters, then choice = 0, it means he doesn&#x27;t want to give any more input; - choice = 0; - printf(&quot;\nCharacter received. Stopping input...\n&quot;); - } - } - // Display the final results - printf(&quot;\n====================================\n&quot;); - printf(&quot; Analysis Complete\n&quot;); - printf(&quot;====================================\n&quot;); - printf(&quot;Positive numbers entered: %d\n&quot;, positive_count); - printf(&quot;Negative numbers entered: %d\n&quot;, negative_count); - printf(&quot;Zeroes entered: %d\n&quot;, zero_count); - printf(&quot;Total numbers recorded: %d\n&quot;, positive_count + negative_count + zero_count); - printf(&quot;====================================\n&quot;); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc032-c', 'luc032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc032.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc032.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc032-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to recieve an integer and find its octal equivalent. -(Hint : To obtain octal equivalent of an integer, Divide it continuously -by 8 till dividend does not become zero, then write the remainders -obtained in reverse derection.) */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(e) */ - -// using array - -#include &lt;stdio.h&gt; -int main() -{ - int octal[20], decimal, index = 0, temp, rem; - printf(&quot;Enter the decimal number : &quot;); - scanf(&quot;%d&quot;, &amp;decimal); - temp = decimal; - while (temp != 0) - { - rem = temp % 8; - temp = temp / 8; - octal[index] = rem; - index++; - } - printf(&quot;\nDeciaml %d to octal : &quot;, decimal); - while ((index - 1) &gt;= 0) - { - printf(&quot;%d&quot;, octal[index - 1]); - index--; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc033-c', 'luc033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc033.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc033.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc033-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the range of a set of numbers entered -through the keyboard. Range is the difference between the smallest -and biggest number in the list. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -/* Let Us C, Chap- 5, Page - 87, Qn No.: B(f) */ - -#include &lt;stdio.h&gt; -int main() -{ - int choice = 1, set_of_numbers[30], num, index = -1; - while (choice == 1) - { - printf(&quot;\nEnter the number (Type any character and press Enter to finish.) : &quot;); - choice = scanf(&quot;%d&quot;, &amp;num); // Checking whether the user has input any characters - if (choice != 1) - { - // If the user inputs any characters, then choice = 0, it means he doesn&#x27;t want to give any more input; - choice = 0; - printf(&quot;\nCharacter received. Stopping input...\n&quot;); - break; - } - index++; - set_of_numbers[index] = num; - } - int max = set_of_numbers[0], min = set_of_numbers[0]; - while (index &gt;= 0) - { - if (max &lt; set_of_numbers[index]) - max = set_of_numbers[index]; - if (min &gt; set_of_numbers[index]) - min = set_of_numbers[index]; - index--; - } - int range = max - min; - printf(&quot;\nBiggest number in the set : %d&quot;, max); - printf(&quot;\nSmallest number in the set : %d&quot;, min); - printf(&quot;\nRange : %d&quot;, range); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc034-c', 'luc034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc034.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc034.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc034-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print the multiplication table of the number -entered by the user. The table should get displayed in the following -form : - 29 * 1 = 29 - 29 * 2 = 58 -*/ -/* Author - Amit Dutta, Date - 20th OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 105, Qn No.: B(a) */ - -#include &lt;stdio.h&gt; -int main() -{ - int i, num, res; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - printf(&quot;\n--- Multiplication Table ---\n&quot;); - for (i = 1; i &lt;= 10; i++) - printf(&quot;%d * %d = %d\n&quot;, num, i, num * i); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc035-c', 'luc035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc035.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc035.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc035-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* According to a study, the approximate level of intelligence of a -person can be calculated using the following formula. - i = 2 + (y + 0.5x) -write a program that will produce a table of values of i, y and x, -where y varies from 1 to 6, and, for each value of y, x varies from -5.5 to 12.5 in steps of 0.5 */ -/* Author - Amit Dutta, Date - 20th OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 105, Qn No.: B(b) */ - -#include &lt;stdio.h&gt; -int main() -{ - double y, x; - printf(&quot;\n--- Approximate Intelligence ---\n&quot;); - for (y = 1; y &lt;= 6; y++) - { - printf(&quot;\tY = %d\n&quot;, y); - for (x = 5.5; x &lt;= 12.5; x += 0.5) - { - printf(&quot;Y: %g\t X: %.2g\t I: %g\n&quot;, y, x, 2 + (y + 0.5 * x)); - } - printf(&quot;-----------------------\n&quot;); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc036-c', 'luc036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc036.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc036.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc036-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* When interest compounds q times per year at an annual rate of -r % for n years, the principle p compounds to an amount a as per -the following formula - a = p (1 + r / q) ^ nq -Write a program to read 10 sets of p, r, n &amp; q and calculate the -corresponding as&#x27; */ -/* Author - Amit Dutta, Date - 20th OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(c) */ - -// DEVELOPMENT STATUS: This implementation is currently untested. -// Please report any functional defects or errors by submitting a GitHub issue &quot;https://github.com/notamitgamer/bsc/issues&quot; with the updated code. - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double interest, principalAmount, interestRate, timeInYears, compoundFactor, totalAmount; - int index; - for (index = 1; index &lt;= 10; index++) - { - printf(&quot;Enter Principle amount : &quot;); - scanf(&quot;%lf&quot;, &amp;principalAmount); - printf(&quot;Enter Rate of Interest : &quot;); - scanf(&quot;%lf&quot;, &amp;interestRate); - interestRate *= 0.01; - printf(&quot;Enter the Time (Years) : &quot;); - scanf(&quot;%lf&quot;, &amp;timeInYears); - printf(&quot;Compound count in one year : &quot;); - scanf(&quot;%lf&quot;, &amp;compoundFactor); - totalAmount = (principalAmount * pow((1 + interestRate / compoundFactor), (timeInYears * compoundFactor))); - interest = totalAmount - principalAmount; - printf(&quot;\nInterest : %.2f\nTotal Amount : %.2f\n\n&quot;, interest, totalAmount); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc037-c', 'luc037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc037.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc037.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc037-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* The natural logarithm can be approximated by the following series. - (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 - 21st OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(d) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -double series(double x) // made this fn only for fun, making a fn was not necessary -{ - double result = (x - 1) / x; - int i; - for (i = 2; i &lt;= 7; i++) - { - result += 0.5 * pow(((x - 1) / x), i); - } - return result; -} - -int main() -{ - double x; - printf(&quot;Enter the value for x : &quot;); - scanf(&quot;%lf&quot;, &amp;x); - printf(&quot;\nResult : %g&quot;, series(x)); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc038-c', 'luc038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc038.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc038.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc038-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to generate all Pythagorean Triplets with slide -length less than or equal to 30. */ -/* Author - Amit Dutta, Date - 21st OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(e) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int main() -{ - int a, b, c; - printf(&quot;Pythagorean Triplets with slide length less than or equal to 30 : \n&quot;); - for (a = 1; a &lt;= 30; a++) - { - for (b = a; b &lt;= 30; b++) - { - int c_square = a * a + b * b; - for (c = b + 1; c &lt;= 30; c++) - { - if (c * c == c_square) - printf(&quot;(%d, %d, %d)\n&quot;, a, b, c); - } - } - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc039-c', 'luc039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc039.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc039.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc039-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Population of a town today is 100000. The population has increased -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 - 21st OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(f) */ - -#include &lt;stdio.h&gt; -int main() -{ - int i, population = 100000; - printf(&quot;Present year : %d\n&quot;, population); - for (i = 1; i &lt;= 10; i++) - { - population /= 1.10; - printf(&quot;%d year ago : %d\n&quot;, i, population); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc040-logic-c', 'luc040-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040-logic.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc040-logic.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc040-logic-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Ramanujan number (1729) is the smallest number that can be -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 - 22nd - 23rd OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ - -// 1. INCLUDE SECTION -#include &lt;stdio.h&gt; // Includes the standard input/output library, necessary for printf() - -// 2. CONSTANT DEFINITIONS (MACROS) -// These define fixed values we can easily use and change later. -#define LIMIT 100000 // The maximum number we want to search up to. -// The maximum base value (a, b, c, or d) we need to check. -// Since 47^3 is greater than 100,000, checking bases up to 47 covers the LIMIT. -#define MAX_BASE_VAL 47 - -// 3. MAIN FUNCTION -int main() -{ - // 4. VARIABLE DECLARATION - - // sum1 and sum2 store the results of a^3 + b^3 and c^3 + d^3. - // We use &#x27;long long&#x27; because cubes (like 47^3) are large and can exceed - // the capacity of a standard &#x27;int&#x27;, preventing errors. - long long sum1, sum2; - - int count = 0; // Counter to keep track of how many Ramanujan numbers we find. - - // This flag is used to optimize the search. If we find the second way (c^3 + d^3) - // to make sum1, we set this to 1 and immediately stop the inner loops. - int found_match; - - // Print introductory message to the user. - printf(&quot;Ramanujan Number Finder (a^3 + b^3 = c^3 + d^3)\n&quot;); - printf(&quot;Searching up to %d (Max base value is %d)\n&quot;, LIMIT, MAX_BASE_VAL); - printf(&quot;---------------------------------------------------\n&quot;); - - // 5. OUTER LOOPS: Establishing the FIRST SUM (a^3 + b^3 = sum1) - - // Loop for &#x27;a&#x27; (the smaller base of the first pair) - for (int a = 1; a &lt;= MAX_BASE_VAL; a++) - { - - // Loop for &#x27;b&#x27; (the larger base of the first pair) - // We start &#x27;b&#x27; at &#x27;a + 1&#x27; to enforce the rule a &lt; b. - // This prevents us from checking redundant pairs like (1, 12) and (12, 1). - for (int b = a + 1; b &lt;= MAX_BASE_VAL; b++) - { - - // Calculate the first sum: sum1 = a^3 + b^3 - // (long long) is a cast to ensure the math is done using the &#x27;long long&#x27; type. - sum1 = (long long)a * a * a + (long long)b * b * b; - - // Optimization 1: Check if the sum exceeds the global limit. - if (sum1 &gt; LIMIT) - { - // Since &#x27;b&#x27; is increasing, any further increase will also be over the limit. - // We stop the &#x27;b&#x27; loop and move to the next &#x27;a&#x27;. - break; - } - - // Reset the flag for every new sum1. - // We start searching for a second way for this new &#x27;sum1&#x27;, so we reset the flag to 0. - found_match = 0; - - // 6. INNER LOOPS: Searching for the SECOND SUM (c^3 + d^3 = sum2) - - // Loop for &#x27;c&#x27; (the smaller base of the second pair) - // We start &#x27;c&#x27; at &#x27;a + 1&#x27; to enforce the rule a &lt; c. - // This ensures the two pairs {(a, b) and (c, d)} are truly distinct (e.g., 1729 = 1^3 + 12^3 and 9^3 + 10^3). - for (int c = a + 1; c &lt;= MAX_BASE_VAL; c++) - { - - // Optimization 2: Check the flag to exit the &#x27;c&#x27; loop early. - if (found_match) - { - // If we already found the second way (c, d) in a previous iteration of &#x27;c&#x27;, stop searching and move to the next (a, b) pair. - break; - } - - // Loop for &#x27;d&#x27; (the larger base of the second pair) - // We start &#x27;d&#x27; at &#x27;c + 1&#x27; to enforce c &lt; d. - for (int d = c + 1; d &lt;= MAX_BASE_VAL; d++) - { - - // Calculate the second sum: sum2 = c^3 + d^3 - sum2 = (long long)c * c * c + (long long)d * d * d; - - // Optimization 3: Check if the second sum has passed the first sum. - if (sum2 &gt; sum1) - { - // Since &#x27;d&#x27; is increasing, any further increase will also be greater than sum1. - // We stop the &#x27;d&#x27; loop and move to the next &#x27;c&#x27;. - break; - } - - // 7. CONDITION CHECK: Have we found a Ramanujan number? - // Check if the two sums are equal. - if (sum1 == sum2) - { - count++; // Increment the counter - - // Print the result in the required format. - printf(&quot;[%d] %lld = %d^3 + %d^3 = %d^3 + %d^3\n&quot;, - count, sum1, a, b, c, d); - - // Set the flag to 1, confirming we found the second way. - found_match = 1; - - // Stop the &#x27;d&#x27; loop immediately, as we found the required second pair. - break; - } - } - // If found_match was set to 1, the &#x27;break&#x27; in the d loop will execute, - // then the &#x27;if (found_match) break;&#x27; in the c loop will execute, - // and the program will move to the next (a, b) pair. - } - } - } - - // 8. CONCLUSION - printf(&quot;---------------------------------------------------\n&quot;); - printf(&quot;Search complete. Found %d Ramanujan-type numbers.\n&quot;, count); - - return 0; // Standard way to indicate successful program execution. -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc040-c', 'luc040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc040.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc040-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Ramanujan number (1729) is the smallest number that can be -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 - 22nd - 23rd OCT, 2025 */ -/* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ - -#include &lt;stdio.h&gt; - -#define limit 100000 -#define max_base 47 - -int main() -{ - - long long sum1, sum2; - int count = 0; - - printf(&quot;Ramanujan numbers : \n&quot;); - - int found_match; - - for (int a = 1; a &lt;= max_base; a++) - { - for (int b = a + 1; b &lt;= max_base; b++) - { - sum1 = (long long)a * a * a + (long long)b * b * b; - if (sum1 &gt; limit) - { - break; - } - - found_match = 0; - - for (int c = a + 1; c &lt;= max_base; c++) - { - if (found_match) - { - break; - } - for (int d = c + 1; d &lt;= max_base; d++) - { - sum2 = (long long)c * c * c + (long long)d * d * d; - if (sum2 &gt; sum1) - { - break; - } - if (sum1 == sum2) - { - count++; - printf(&quot;(%d.) %lld = %d^3 + %d^3 = %d^3 + %d^3\n&quot;, count, sum1, a, b, c, d); - - found_match = 1; - break; - } - } - } - } - } - - printf(&quot;-------------------------------\n&quot;); - printf(&quot;Search complete.&quot;); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc041-c', 'luc041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc041.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc041.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc041-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc042-c', 'luc042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc042.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc042.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc042-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc043-c', 'luc043.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc043.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc043.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc043.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc043-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the grace marks for a student using switch. -The user should enter the class obtained by the student and the -number of subjects he has failed in. Use the following logic. - - If the student gets first class and he fails in more than 3 - subjects, he does not get any grace, Otherwise, he gets a grace - of 5 marks per subject. - - If the student gets second class and he fails in more than 2 - subjects, he does not get any grace. Otherwise, he gets a grace - of 4 marks per subject. - - If the student gets third class and he fails in more than 1 - subject, then he does not get any grace. Otherwise, he gets a - grace of 5 marks. -*/ -/* Author - Amit Dutta, Date - 28th OCT, 2025 */ -/* Let Us C, Chap- 7, Page - 125, Qn No.: C */ - -#include &lt;stdio.h&gt; - -int main() -{ - int studentClass, failedSubjectCount, graceMarks = 0; - printf(&quot;Class obtained by the student (Enter 1 for First Class, 2 for Second Class, 3 for Third Class): &quot;); - scanf(&quot;%d&quot;, &amp;studentClass); - printf(&quot;Failed Subject Count: &quot;); - scanf(&quot;%d&quot;, &amp;failedSubjectCount); - - if (failedSubjectCount &lt; 0) { - printf(&quot;\nFailed subject count cannot be negative.&quot;); - return 1; - } - - switch (studentClass) - { - case 1: - if (failedSubjectCount &lt;= 3) - { - graceMarks += 5 * failedSubjectCount; - } - break; - - case 2: - if (failedSubjectCount &lt;= 2) - { - graceMarks += 4 * failedSubjectCount; - } - break; - - case 3: - if (failedSubjectCount &lt;= 1) - { - graceMarks += 5 * failedSubjectCount; - } - break; - - default: - printf(&quot;\nWrong Choice.&quot;); - return 1; - } - - printf(&quot;\nStudent will get %d grace marks.&quot;, graceMarks); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc044-c', 'luc044.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc044.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc044.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc044.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc044-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Any year is entered through the keyboard. Write a function to -determine whether the year is aleap year or not. */ -/* Author - Amit Dutta, Date - 17th November, 2025 */ -/* Let Us C, Chap- 8, Page - 144, Qn No.: C(1) */ - -#include &lt;stdio.h&gt; - -int leapYear(int); - -int leapYear(int year) -{ - if ((year % 400 == 0) || ((year % 4 == 0) &amp;&amp; (year % 100 != 0))) - return 1; - else - return 0; -} - -int main() -{ - int year; - printf(&quot;Enter the year : &quot;); - scanf(&quot;%d&quot;, &amp;year); - if (leapYear(year)) - printf(&quot;\nYear %d is a Leap Year.&quot;, year); - else - printf(&quot;\nYear %d is not a Leap Year.&quot;, year); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc045-c', 'luc045.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc045.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc045.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc045.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc045-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A position integer is entered through the keyboard. Write a Function -to obtain the prime factors of this number. -For example, prime factors of 24 are 2, 2, 2 and 3, whereas prime -factors of 35 are 5 and 7 -*/ -/* Author - Amit Dutta, Date - 17th November, 2025 */ -/* Let Us C, Chap- 8, Page - 144, Qn No.: C(2) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -void findPrimeFactors(int n) -{ - int temp_n = n; - - if (temp_n == 1) - { - printf(&quot;Prime factors of %d are: None.\n&quot;, n); - return; - } - - printf(&quot;Prime factors of %d are:&quot;, n); - - while (temp_n % 2 == 0) - { - printf(&quot; %d&quot;, 2); - temp_n = temp_n / 2; - } - - for (int i = 3; i &lt;= (int)sqrt(temp_n); i = i + 2) - { - while (temp_n % i == 0) - { - printf(&quot; %d&quot;, i); - temp_n = temp_n / i; - } - } - - if (temp_n &gt; 2) - { - printf(&quot; %d&quot;, temp_n); - } - - printf(&quot;\n&quot;); -} - -int main() -{ - int n; - printf(&quot;Enter a positive integer to get the prime factors: &quot;); - if (scanf(&quot;%d&quot;, &amp;n) != 1) - { - printf(&quot;Error: Invalid input. Please enter an integer.\n&quot;); - return 1; - } - if (n &lt;= 0) - { - printf(&quot;Error: Please enter a POSITIVE integer.\n&quot;); - return 1; - } - findPrimeFactors(n); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc046-c', 'luc046.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc046.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc046.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc046.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc046-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Given three variables x, y, z, write a function to circularly shift their -values to right. In other words, if x = 5, y = 8, z = 10, after circular -shift y = 5, z = 8, x = 10. cal the function with variables a, b, c to -circularly shift values. -*/ -/* Author - Amit Dutta, Date - 24th November, 2025 */ -/* Let Us C, Chap- 9, Page - 163, Qn No.: C(a) */ - -#include &lt;stdio.h&gt; - -void circularShift(int *, int *, int *); - -int main() -{ - int x = 5, y = 8, z = 10; - - printf(&quot;--- Before Shift ---\n&quot;); - printf(&quot;x: %d, y: %d, z: %d&quot;, x, y, z); - - circularShift(&amp;x, &amp;y, &amp;z); - - printf(&quot;\n--- After Shift ---\n&quot;); - printf(&quot;x: %d, y: %d, z: %d&quot;, x, y, z); - - return 0; -} - -void circularShift(int *x, int *y, int *z) -{ - int temp = *z; - *z = *y; - *y = *x; - *x = temp; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc047-c', 'luc047.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc047.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc047.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc047.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc047-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Define a function that receives weight of a commodity in kilograms -and returns the equivalent weight in Grams, Tons and pounds. Call -this fuction from main() and print the results in main() -*/ -/* Author - Amit Dutta, Date - 24th November, 2025 */ -/* Let Us C, Chap- 9, Page - 163, Qn No.: C(b) */ - -#include &lt;stdio.h&gt; - -void convertWeight(double, double *, double *, double *); - -int main() -{ - double weightGram, weightPound, weightKG, weightTON; - printf(&quot;Enter the weight of the comodity in Kilogram(s): &quot;); - scanf(&quot;%lf&quot;, &amp;weightKG); - - convertWeight(weightKG, &amp;weightGram, &amp;weightPound, &amp;weightTON); - printf(&quot;\n%g Kilogram(s) = %.04f Gram(s)&quot; - &quot;\n%g Kilogram(s) = %.04f Pound(s)&quot; - &quot;\n%g Kilogram(s) = %.04f TON(s)&quot;, - weightKG, weightGram, weightKG, weightPound, weightKG, weightTON); - return 0; -} - -void convertWeight(double weightKG, double *weightGram, double *weightPound, double *weightTON) -{ - *weightGram = weightKG * 1000.0; - *weightPound = weightKG * 2.2046226218; - *weightTON = weightKG / 1000.0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc048-c', 'luc048.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc048.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc048.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc048.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-luc048-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Define a function to compute the distance between two points and -use it to develop another function that will compute the area of the -triangle whose vertices are A(x1, y1), B(x2, y2), and C(x3, y3). Use -these functions to develop a function which returns a value 1 if the -point (x, y) lines inside the triangle ABC, otherwise returns a value -0. Would you get any advantage if you develop these functions to -work on call by reference principle? -*/ -/* Author - Amit Dutta, Date - 25th November, 2025 */ -/* Let Us C, Chap- 9 (Pointers), Page - 163, Qn No.: C(c) */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;ctype.h&gt; -#include &lt;stdlib.h&gt; - -void distance(double, double, double, double, double *); -void area(double, double, double, double, double, double, double *); -int is_inside(double, double, double, double, double, double, double, double); - -int main() -{ - - // Variables - double x, y, x1, x2, y1, y2, x3, y3, result_Distance, result_Area; - char choice; - - /* ********** Requirement: 1 ********** */ - - // Calculate the length of the line segment between two points, P1(x1, y1) and P2(x2, y2). - // Function Used: distance() - - printf(&quot;--- Compute the distance between two points ---\n\n&quot;); - printf(&quot;Enter the co-ordinates of Point 1 (Ex.: 5,6): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); - printf(&quot;Enter the co-ordinates of Point 2 (Ex.: 3,4): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); - - distance(x1, y1, x2, y2, &amp;result_Distance); - printf(&quot;\nDistance between P1(%g, %g) and P2(%g, %g) = %g&quot;, - x1, y1, x2, y2, result_Distance); - - /* ********** Requirement: 2 ********** */ - - // Calculate the area of a triangle ABC using its three vertices A(x1, y1), B(x2, y2), and C(x3, y3). - // Fuction Used: distance(), area() - - printf(&quot;\n\n--- Compute the area of a triangle ABC ---\n\n&quot;); - printf(&quot;Enter the co-ordinates of Point A (Ex.: 5,6): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); - printf(&quot;Enter the co-ordinates of Point B (Ex.: 3,4): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); - printf(&quot;Enter the co-ordinates of Point C (Ex.: 6,7): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x3, &amp;y3); - - area(x1, y1, x2, y2, x3, y3, &amp;result_Area); - printf(&quot;\nArea of the A(%g, %g), B(%g, %g), C(%g, %g) = %g&quot;, - x1, y1, x2, y2, x3, y3, result_Area); - - /* ********** Requirement: 3 ********** */ - - // Check if a test point P(x, y) lies strictly inside the triangle ABC. - // Function Used: distance(), area(), is_inside() - - printf(&quot;\n\n--- Check if a test point P(x, y) lies strictly inside the triangle ABC ---\n\n&quot;); - printf(&quot;Do you wish to use previous entered triangle?&quot; - &quot;\nIf Yes, type &#x27;Y&#x27;; If No, type &#x27;N&#x27;: &quot;); - scanf(&quot; %c&quot;, &amp;choice); - choice = toupper(choice); - switch (choice) - { - case &#x27;Y&#x27;: - break; - case &#x27;N&#x27;: - printf(&quot;Enter the co-ordinates of Point A (Ex.: 5,6): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); - printf(&quot;Enter the co-ordinates of Point B (Ex.: 3,4): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); - printf(&quot;Enter the co-ordinates of Point C (Ex.: 6,7): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x3, &amp;y3); - break; - default: - printf(&quot;\nYou entered invalid choice.&quot;); - break; - } - printf(&quot;Enter the co-ordinates of Test Point (Ex.: 3,5): &quot;); - scanf(&quot;%lf,%lf&quot;, &amp;x, &amp;y); - - if (is_inside(x, y, x1, y1, x2, y2, x3, y3)) - printf(&quot;\nTest Point (%g, %g) is inside ABC.&quot;, x, y); - else - printf(&quot;\nTest Point (%g, %g) is not inside ABC.&quot;, x, y); - - /* ANSWER TO THE QUESTION: - Qn.: - Would you get any advantage if you develop these functions to - work on call by reference principle? - - Ans: - NO, there is no advantage, and moreover, that would be a disadvantage. - It introduces unnecessary dereferencing overhead for every operation, - Which is less efficient than reading the simple value copy supplied by Call by Value. - */ - - // End of Program - return 0; -} - -void distance(double x1, double y1, double x2, double y2, double *result_Distance) -{ - *result_Distance = sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2)); -} - -void area(double x1, double y1, double x2, double y2, double x3, double y3, double *result_Area) -{ - double s, ab, bc, ac; - - distance(x1, y1, x2, y2, &amp;ab); - distance(x2, y2, x3, y3, &amp;bc); - distance(x1, y1, x3, y3, &amp;ac); - - s = (ab + bc + ac) / 2.0; - double area_sq = s * (s - ab) * (s - bc) * (s - ac); - - if (area_sq &lt; 0) - // Handle cases where area_sq is slightly negative due to floating-point errors - *result_Area = 0.0; - else - *result_Area = sqrt(area_sq); -} - -int is_inside(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3) -{ - double area_ABC, area_PAB, area_PBC, area_PAC; - - const double EPSILON = 0.000001; - - area(x1, y1, x2, y2, x3, y3, &amp;area_ABC); - area(x, y, x1, y1, x2, y2, &amp;area_PAB); - area(x, y, x2, y2, x3, y3, &amp;area_PBC); - area(x, y, x1, y1, x3, y3, &amp;area_PAC); - - double sum_of_sub_areas = area_PAB + area_PBC + area_PAC; - - if (fabs(area_ABC - sum_of_sub_areas) &lt; EPSILON) - return 1; - else - return 0; -} - -/* - *************** SAMPLE OUTPUT *************** - -PS G:\bsc\letusc&gt; ./*.exe ---- Compute the distance between two points --- - -Enter the co-ordinates of Point 1 (Ex.: 5,6): 1234.56,7890.12 -Enter the co-ordinates of Point 2 (Ex.: 3,4): 1234.56,7891.12 - -Distance between P1(1234.56, 7890.12) and P2(1234.56, 7891.12) = 1 - ---- Compute the area of a triangle ABC --- - -Enter the co-ordinates of Point A (Ex.: 5,6): 100.10,200.20 -Enter the co-ordinates of Point B (Ex.: 3,4): 105.10,200.20 -Enter the co-ordinates of Point C (Ex.: 6,7): 100.10,205.20 - -Area of the A(100.1, 200.2), B(105.1, 200.2), C(100.1, 205.2) = 12.5 - ---- Check if a test point P(x, y) lies strictly inside the triangle ABC --- - -Do you wish to use previous entered triangle? -If Yes, type &#x27;Y&#x27;; If No, type &#x27;N&#x27;: y -Enter the co-ordinates of Test Point (Ex.: 3,5): 101.10,201.20 - -Test Point (101.1, 201.2) is inside ABC. - -*/</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem001-c', 'lucproblem001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Consider a currency system in which there are notes of six denominations, -namely, Rs. 1, Rs. 2, rs. 5, Rs. 10, Rs. 50, Rs. 100. If a sum -of Rs. N is entered through the keyboard, Write a program to compute -the smallest number of notes that will combine to give Rs. N. */ -/* Author - Amit Dutta, Date - 29th SEP, 2025 */ -/* Let Us C, Chap - 2, Page - 22, Problem 2.3 */ - -#include &lt;stdio.h&gt; -int main() -{ - int n, nonotes, temp; - printf(&quot;Enter the amount : &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (n &lt; 1) - { - printf(&quot;\nAmount should be a positive integer.&quot;); - return 1; - } - temp = n; - nonotes = n / 100; - n = n % 100; - nonotes = nonotes + (n / 50); - n = n % 50; - nonotes = nonotes + (n / 10); - n = n % 10; - nonotes = nonotes + (n / 5); - n = n % 5; - nonotes = nonotes + (n / 2); - n = n % 2; - nonotes = nonotes + n; - printf(&quot;\nthe smallest number of notes that will combine to give Rs. %d : %d&quot;, temp, nonotes); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem002-c', 'lucproblem002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A year is entered through the keyboard, write a program to -determine whether the year is leap or not. Use the logical operators -&amp;&amp; and || . */ -/* Author - Amit Dutta, Date - 02th OCT, 2025 */ -/* Let Us C, Chap - 4, Page - 64, Problem 4.1 */ - -#include &lt;stdio.h&gt; -int main() -{ - int year; - printf(&quot;Enter year : &quot;); - scanf(&quot;%d&quot;, &amp;year); - if (year % 4 == 0 &amp;&amp; year &amp; 100 != 0 || year % 400 == 0) - printf(&quot;\nYear %d is a leapyear.&quot;, year); - else - printf(&quot;\nYear %d is not a leapyear.&quot;, year); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem003-c', 'lucproblem003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If a character is entered through the keyboard, Write a program -to determine whether the character is a capital letter, a small case letter, -a digit or a speacial symbol. -The following table shows the range of ASCII values for various characters : - Characters ASCII Values - A - Z 65 - 90 - a - z 97 - 122 - 0 - 9 48 - 57 - special symbols 0 - 47, 58 - 64, 91 - 96, 123 - 127 -*/ -/* Author - Amit Dutta, Date - 02th OCT, 2025 */ -/* Let Us C, Chap - 4, Page - 65, Problem 4.2 */ - -#include &lt;stdio.h&gt; -int main() -{ - char inp; - printf(&quot;Enter one character : &quot;); - scanf(&quot; %c&quot;, &amp;inp); - if (inp &gt;= 64 &amp;&amp; inp &lt;= 90) - printf(&quot;\nInput &#x27;%c&#x27; is a CAPITAL LETTER.&quot;, inp); - if (inp &gt;= 97 &amp;&amp; inp &lt;= 122) - printf(&quot;\nInput &#x27;%c&#x27; is a SMALL CASE LETTER.&quot;, inp); - if (inp &gt;= 48 &amp;&amp; inp &lt;= 57) - printf(&quot;\nInput &#x27;%c&#x27; is a DIGIT.&quot;, inp); - if (inp &gt;= 0 &amp;&amp; inp &lt;= 47 || inp &gt;= 58 &amp;&amp; inp &lt;= 64 - || inp &gt;= 91 &amp;&amp; inp &lt;= 96 || inp &gt;= 123 &amp;&amp; inp &lt;= 127) - printf(&quot;\nInput &#x27;%c&#x27; is a SPECIAL SYMBOL.&quot;, inp); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem004-c', 'lucproblem004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* If the lengths of three sides of a triangle are entered through the -keyboard, write a program to check whether the triangle is valid or not. -The triangle is valid if the sum of two sides is greater that the largest -of the three sides. */ -/* Author - Amit Dutta, Date - 02th OCT, 2025 */ -/* Let Us C, Chap - 4, Page - 66, Problem 4.3 */ - -#include &lt;stdio.h&gt; -int main() -{ - double side1, side2, side3; - printf(&quot;Enter the length of side1, side2 and side3 of the triangle : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;side1, &amp;side2, &amp;side3); - if (side1 &lt;= 0 || side2 &lt;= 0 || side3 &lt;= 0) - { - printf(&quot;\nTriangle sides must be positive.\n&quot;); - return 1; - } - if ((side1 + side2 &gt; side3) &amp;&amp; (side1 + side3 &gt; side2) &amp;&amp; (side2 + side3 &gt; side1)) - // Triangle Inequality Theorem - printf(&quot;\nThis triangle is valid.&quot;); - else - printf(&quot;\nThis triangle is not valid.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem005-c', 'lucproblem005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate overtime pay of 10 employees. Overtime is -paid at the rate of Rs. 120.00 per hour for every hour worked above 40 -hours. Assume that employees do not work for fractional part of an hour. */ -/* ONLY WHILE LOOP ALLOWED */ -/* Author - Amit Dutta, Date - 07th OCT, 2025 */ -/* Let Us C, Chap - 5, Page - 83, Problem 5.1 */ - -#include &lt;stdio.h&gt; -#include &lt;conio.h&gt; -int main() -{ - int working_hour, i = 1; - double pay; - while (i &lt;= 10) - { - printf(&quot;Enter the working hour for the employee no. %d : &quot;, i); - if (scanf(&quot;%d&quot;, &amp;working_hour) != 1) - { - printf(&quot;\n\tPlease enter a number as woking hour.\n\n&quot;); - while (getchar() != &#x27;\n&#x27;) - ; - // above line discard the input characters untill getchar() reaches the new line character. - /* if I do not discard the input, after &#x27;continue;&#x27; statement that input will be again taken - by scanf (In the line 17). It will be a infinite loop of error. */ - continue; - } - // checking overtime - if (working_hour &gt; 40) - { - pay = (working_hour - 40) * 120.00; - printf(&quot;\n\tOvertime working hours of Employee %d : %d&quot;, i, (working_hour - 40)); - printf(&quot;\n\tPay of the overtime for Employee %d : Rs. %.2f\n\n&quot;, i, pay); - } - else - printf(&quot;\n\tEmployee %d did not work any overtime.\n\n&quot;, i); - i++; // changing to next employee - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem006-c', 'lucproblem006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the factorial value of any number entered -through the keyboard. */ -/* Author - Amit Dutta, Date - 07th OCT, 2025 */ -/* Let Us C, Chap - 5, Page - 84, Problem 5.2 */ - -#include &lt;stdio.h&gt; -int main() -{ - int num, i = 1; - long long fact = 1; - printf(&quot;Enter the number : &quot;); - // checking if the input is valid or not - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - return 1; - } - // result for the negetive input - if (num &lt; 0) - { - printf(&quot;\nFactorial of %d : Undefined&quot;, num); - return 1; - } - // Hard codded result for input &#x27;0&#x27; (zero) - if (num == 0) - { - printf(&quot;\nFactorial of 0 : 1&quot;); - return 0; - } - // calculating result - while (i &lt;= num) { - fact = fact * i; - i++; - } - printf(&quot;\nFactorial of %d : %d&quot;, num, fact); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem007-c', 'lucproblem007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Two numbers are entered through the keyboard. Write a program to -find the value of one number raised to the power of another */ -/* Author - Amit Dutta, Date - 07th OCT, 2025 */ -/* Let Us C, Chap - 5, Page - 84, Problem 5.3 */ - -#include &lt;stdio.h&gt; -int main() -{ - double num, result; - int power, i = 1; - printf(&quot;Enter the numbers in &#x27;num^power&#x27; format : &quot;); - // checking if the input is valid or not - if (scanf(&quot;%lf^%d&quot;, &amp;num, &amp;power) != 2) - { - printf(&quot;\nPlease enter numbers.&quot;); - return 1; - } - // result for the negetive input - if (power &lt; 0) - { - printf(&quot;\nPlease use a positive number as power.&quot;); - return 1; - } - // Hard codded result for input &#x27;0&#x27; (zero) - if (power == 0) - { - printf(&quot;\n%g to the power of %d is : 1&quot;, num, power); - return 0; - } - result = num; - while (i &lt;= power - 1) - { - result = result * num; - i++; - } - printf(&quot;\n%g to the power of %d is : %g&quot;, num, power, result); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem008-c', 'lucproblem008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a problem to print all the prime numbers from 1 to 300. */ -/* Author - Amit Dutta, Date - 24th OCT, 2025 */ -/* Let Us C, Chap - 6, Page - 101, Problem 6.1 */ - -// Method: Trial Division (Optimized to check up to sqrt(N)) - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;stdbool.h&gt; - -#define LIMIT 300 - -int main() -{ - printf(&quot;Prime numbers from 1 to 300 : 2&quot;); // as 2 is the only even prime number - for (int i = 3; i &lt;= LIMIT; i += 2) // skipping all other even number - { - int n = (int)sqrt(i); - bool prime = true; - - for (int j = 3; j &lt;= n; j += 2) - // an odd number is only devisable by another odd number. - // so, skipping even number. - { - if (i % j == 0) - { - prime = false; - break; - } - } - if (prime) - { - printf(&quot; %d&quot;, i); - } - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem009-c', 'lucproblem009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to add first seven terms of the following series using a -for loop. - 1 / 1! + 2 / 2! + 3 / 3! + ... -*/ -/* Author - Amit Dutta, Date - 24th OCT, 2025 */ -/* Let Us C, Chap - 6, Page - 102, Problem 6.2 */ - -#include &lt;stdio.h&gt; -#define N 7 // update N here - -int main() -{ - double sum = 0; int fact = 1; - for (int i = 1; i &lt;= N; i++) - { - fact *= i; - sum += (double)i / fact; - } - printf(&quot;Sum of the series : %g&quot;, sum); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem010-complex-c', 'lucproblem010-complex.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010-complex.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem010-complex.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010-complex.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem010-complex-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to generate all combinations (permutations) of 1, 2 and 3 - from 1-digit numbers up to 4-digit numbers using a main loop to control - the number of digits (1 to 3333). -*/ -/* Author - Amit Dutta, Date - 24th OCT, 2025 */ -/* Let Us C, Chap - 6, Page - 103, Problem 6.3 */ - -#include &lt;stdio.h&gt; - -// --- RECURSIVE FUNCTION TO ACHIEVE DYNAMIC NESTING --- -// current_digit: The digit being placed in the current position (1, 2, or 3) -// target_length: The total length of the number we are building (e.g., 3 for 3-digit numbers) -// current_number: The integer value built so far -// current_length: How many digits have been placed so far -void generate_combinations(int target_length, int current_number, int current_length) -{ - - // Base Case 1: The number is complete. Print it and return. - if (current_length == target_length) - { - printf(&quot; %d&quot;, current_number); - return; - } - - // Recursive Step: Try placing the next digit (1, 2, or 3) - // The for loop now iterates through the *possible values* for the next digit. - for (int next_digit = 1; next_digit &lt;= 3; next_digit++) - { - - // Build the new number: old_number * 10 + next_digit - int new_number = current_number * 10 + next_digit; - - // Recurse: Try to place the next digit - generate_combinations(target_length, new_number, current_length + 1); - } -} - -int main() -{ - printf(&quot;Combination of 1, 2 and 3 (1-digit up to 4-digits):\n&quot;); - - /* This outer loop achieves the structure you were going for: - iterating through the required number of digits (1, 2, 3, 4). - */ - for (int noOfDigits = 1; noOfDigits &lt;= 4; noOfDigits++) - { - printf(&quot;\n\n--- %d-DIGIT NUMBERS (%d total) ---\n&quot;, noOfDigits, (1 &lt;&lt; noOfDigits) * 3 / 4 * 4 / 3 * 3 * 3 / 9 * 3 + (noOfDigits == 1 ? 0 : 9) + (noOfDigits == 2 ? 0 : 9) + (noOfDigits == 3 ? 0 : 81) + (noOfDigits == 4 ? 0 : 0) + (noOfDigits == 1 ? 3 : 0) + (noOfDigits == 2 ? 9 : 0) + (noOfDigits == 3 ? 27 : 0) + (noOfDigits == 4 ? 81 : 0)); // Prints the count 3, 9, 27, or 81 - - // Start the recursive generation for the current length - generate_combinations(noOfDigits, 0, 0); - } - - printf(&quot;\n\nTotal permutations generated: 120\n&quot;); - - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem010-c', 'lucproblem010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to generate all combination of 1, 2 and 3 using for loop. */ -/* Author - Amit Dutta, Date - 24th OCT, 2025 */ -/* Let Us C, Chap - 6, Page - 103, Problem 6.3 */ - -#include &lt;stdio.h&gt; - -int main() -{ - printf(&quot;Combination of 1, 2 and 3 :&quot;); - - // for 1 digit numbers - for (int i = 1; i &lt;= 3; i++) - { - printf(&quot; %d&quot;, i); - } - - // for 2 digit numbers - for (int i = 1; i &lt;= 3; i++) - { - for (int j = 1; j &lt;= 3; j++) - { - printf(&quot; %d%d&quot;, i, j); - } - } - - // for 3 digit numbers - for (int i = 1; i &lt;= 3; i++) - { - for (int j = 1; j &lt;= 3; j++) - { - for (int k = 1; k &lt;= 3; k++) - { - printf(&quot; %d%d%d&quot;, i, j, k); - } - } - } - - // for 4 digit numbers - for (int i = 1; i &lt;= 3; i++) - { - for (int j = 1; j &lt;= 3; j++) - { - for (int k = 1; k &lt;= 3; k++) - { - for (int l = 1; l &lt;= 3; l++) - { - printf(&quot; %d%d%d%d&quot;, i, j, k, l); - } - } - } - } - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem011-c', 'lucproblem011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a menu driven program which has following options : - 1. Factorial of a number - 2. Prime or not - 3. Odd or even - 4. Exit -Once a menu item is selected the appropriate action should be taken -and once this action is finished, the menu should reappear. Unless -the user selects the &#x27;Exit&#x27; option the program should continue work. -*/ -/* Author - Amit Dutta, Date - 26th OCT, 2025 */ -/* Let Us C, Chap - 7, Page - 118, Problem 7.1 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;stdbool.h&gt; - -// Function to clear the input buffer after scanf to prevent issues in the next input. -void clearInputBuffer() -{ - int c; - while ((c = getchar()) != &#x27;\n&#x27; &amp;&amp; c != EOF) - ; -} - -// Calculates the factorial of the input number. -void factorial(int num) -{ - // Factorial is not defined for negative numbers. - if (num &lt; 0) - { - printf(&quot;\nFactorial is not defined for negative numbers.&quot;); - return; - } - // Checks for input over 20 to prevent long long integer overflow (20! is max safe). - if (num &gt; 20) - { - printf(&quot;\nFactorial of %d is too large to calculate (max safe integer factorial is 20!).&quot;, num); - return; - } - long long fact = 1; - // Calculate factorial iteratively. - for (int i = 1; i &lt;= num; i++) - { - fact *= i; - } - printf(&quot;\nFactorial of %d = %lld&quot;, num, fact); - return; -} - -// Checks if the input number is a prime number. -void prime(int num) -{ - // Handle special cases: 1 and 2. - if (num == 1) - { - printf(&quot;\nInput 1 is NOT a PRIME NUMBER.&quot;); - return; - } - else if (num == 2) - { - printf(&quot;\nInput 2 is a PRIME NUMBER. (Fact : 2 is only even prime number)&quot;); - return; - } - // Exclude all other even numbers. - if (num % 2 == 0) - { - printf(&quot;\nInput %d is NOT a PRIME NUMBER.&quot;, num); - return; - } - // Optimization: Only check divisors up to the square root of num. - int endCheckDigit = sqrt(num); - bool isPrime = true; - // Check only odd divisors (i += 2) starting from 3. - for (int i = 3; i &lt;= endCheckDigit; i += 2) - { - if (num % i == 0) - { - printf(&quot;\nInput %d is NOT a PRIME NUMBER.&quot;, num); - isPrime = false; - break; - } - } - if (isPrime) - { - printf(&quot;\nInput %d is a PRIME NUMBER.&quot;, num); - return; - } -} - -// Checks if the input number is odd or even. -void oddoreven(int num) -{ - // A number is even if it is perfectly divisible by 2. - if (num % 2 == 0) - { - printf(&quot;\nInput %d is a EVEN NUMBER.&quot;, num); - return; - } - else - { - printf(&quot;\nInput %d is a ODD NUMBER.&quot;, num); - return; - } -} - -// Main function: displays the menu and controls program flow. -int main() -{ - int choice, num; - // Infinite loop ensures the menu reappears after every operation until &#x27;Exit&#x27; is chosen. - while (1) - { - // Display menu options. - printf(&quot;\n\n===== MENU =====&quot; - &quot;\n1. Factorial of a number&quot; - &quot;\n2. Prime or not&quot; - &quot;\n3. Odd or Even&quot; - &quot;\n4. Exit&quot;); - printf(&quot;\nEnter your choice : &quot;); - - // Input validation for menu choice. - if (scanf(&quot;%d&quot;, &amp;choice) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - clearInputBuffer(); - continue; - } - clearInputBuffer(); - - // Handle menu selection using switch-case. - switch (choice) - { - case 1: - printf(&quot;\n=== FACTORIAL OF A NUMBER ===&quot;); - printf(&quot;\nEnter the number : &quot;); - // Input validation for the number to be factored. - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - clearInputBuffer(); - continue; - } - clearInputBuffer(); - factorial(num); - break; - case 2: - printf(&quot;\n=== PRIME OR NOT ===&quot;); - printf(&quot;\nEnter the number : &quot;); - // Input validation for the number to be checked. - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - clearInputBuffer(); - continue; - } - clearInputBuffer(); - // Require a non-negative, non-zero number for prime check. - if (num &lt; 0) - { - printf(&quot;\nPlease enter a postive number.&quot;); - continue; - } - else if (num == 0) - { - printf(&quot;\nPlease enter a non-zero number.&quot;); - continue; - } - prime(num); - break; - case 3: - printf(&quot;\n=== ODD OR EVEN ===&quot;); - printf(&quot;\nEnter the number : &quot;); - // Input validation for the number to be checked. - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - clearInputBuffer(); - continue; - } - clearInputBuffer(); - oddoreven(num); - break; - case 4: - // Exit the program cleanly. - printf(&quot;\nExiting the program.\n\nSAYONARA...\n\n&quot;); - exit(0); - default: - // Handle invalid menu choice input. - printf(&quot;\nPlease enter a valid choice.&quot;); - break; - } - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem012-c', 'lucproblem012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a Function power(a, b), to calculate the value of a raised to b */ -/* Author - Amit Dutta, Date - 17th November, 2025 */ -/* Let Us C, Chap - 8, Page - 141, Problem 8.2 */ - -#include &lt;stdio.h&gt; - -double power(double, int); - -double power(double a, int b) -{ - if (b == 0) - return 1; - double res = 1; - int i; - if (b &gt; 0) - for (i = 1; i &lt;= b; i++) - res *= a; - return res; -} - -int main() -{ - double a, result; - int b; - printf(&quot;Enter the value and the power (Format A^B) : &quot;); - scanf(&quot;%lf^%d&quot;, &amp;a, &amp;b); - result = power(a, b); - printf(&quot;Result of %g^%d = %g&quot;, a, b, result); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem013-c', 'lucproblem013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem013.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem013.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem013-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Define a function to convert any given year into its Roman equivalent. -Use these roman equivalent for decimal numbers : 1 - I, 5 - V, 10 - X, -50 - L, 100 - C, 500 - D, 1000 - M */ -/* Author - Amit Dutta, Date - 17th November, 2025 */ -/* Let Us C, Chap - 8, Page - 141, Problem 8.3 */ - -#include &lt;stdio.h&gt; - -void romanise(int); - -void romanise(int year) -{ - int values[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; - const char *romanChar[] = {&quot;M&quot;, &quot;CM&quot;, &quot;D&quot;, &quot;CD&quot;, &quot;C&quot;, &quot;XC&quot;, &quot;L&quot;, &quot;XL&quot;, &quot;X&quot;, &quot;IX&quot;, &quot;V&quot;, &quot;IV&quot;, &quot;I&quot;}; - // including the two-character subtractive pairs. - int i = 0; - - printf(&quot;Year %d = &quot;, year); - while (year &gt; 0) - { - if (year &gt;= values[i]) - { - printf(&quot;%s&quot;, romanChar[i]); - year -= values[i]; - } - else - i++; - } -} - -int main() -{ - int year; - printf(&quot;Enter the year : &quot;); - scanf(&quot;%d&quot;, &amp;year); - romanise(year); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem014-short-c', 'lucproblem014-short.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014-short.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem014-short.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014-short.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem014-short-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function that receives integers and returns the sum, average -and standard deviation of these numbers. Call this function from main() -and print the result in main() */ -/* Author - Amit Dutta, Date - 23th November, 2025 */ -/* Let Us C, Chap - 9, Page 159, Problem 9.1 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -void stats(double *, double *, double *); - -int main() -{ - double sum, average, standardDeviation; - stats(&amp;sum, &amp;average, &amp;standardDeviation); - - printf(&quot;\n--- Stats ---&quot; - &quot;\nSum: %g&quot; - &quot;\nAverage: %g&quot; - &quot;\nStandard Deviation: %g&quot;, - sum, average, standardDeviation); - return 0; -} - -void stats(double *sum, double *average, double *standardDeviation) -{ - int n; - printf(&quot;How many numbers you want to give input: &quot;); - scanf(&quot;%d&quot;, &amp;n); - - double inputNumber[n]; - int i; - - printf(&quot;\n--- Enter Numbers ---\n&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter number %d: &quot;, i + 1); - scanf(&quot;%lf&quot;, &amp;inputNumber[i]); - } - - double tempSum = 0; - for (i = 0; i &lt; n; i++) - tempSum += inputNumber[i]; - - double tempAverage = tempSum / n; - - double tempStandardDeviation = 0.0; - - if (n &gt; 1) - { - double tempSumation = 0; - for (i = 0; i &lt; n; i++) - tempSumation += pow((inputNumber[i] - tempAverage), 2.0); - - tempStandardDeviation = sqrt(tempSumation / (n - 1)); - } - - *sum = tempSum; - *average = tempAverage; - *standardDeviation = tempStandardDeviation; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem014-c', 'lucproblem014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem014.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem014-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function that receives integers and returns the sum, average -and standard deviation of these numbers. Call this function from main() -and print the result in main() */ -/* Author - Amit Dutta, Date - 23th November, 2025 */ -/* Let Us C, Chap - 9, Page 158, Problem 9.1 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -// Function prototype: Using pointers for &#x27;call by reference&#x27; to return 3 values. -void stats(double *, double *, double *); - -int main() -{ - double sum, average, standardDeviation; - // Passing addresses of variables to receive results from the function. - stats(&amp;sum, &amp;average, &amp;standardDeviation); - - printf(&quot;\n--- Stats ---&quot; - &quot;\nSum: %g&quot; - &quot;\nAverage: %g&quot; - &quot;\nStandard Deviation: %g&quot;, - sum, average, standardDeviation); - return 0; -} - -// Function to calculate statistics on user-provided numbers. -void stats(double *sum, double *average, double *standardDeviation) -{ - int n; - // Input Validation Loop for N - do - { - printf(&quot;How many numbers you want to give input: &quot;); - - if (scanf(&quot;%d&quot;, &amp;n) == 1) - { - break; - } - else - { - printf(&quot;\nPlease enter a valid number.\n&quot;); - // Clearing input buffer to handle invalid input - while (getchar() != &#x27;\n&#x27; &amp;&amp; !feof(stdin)) - ; - } - } while (1); - - // Variable-Length Array (VLA) to store the input numbers. - double inputNumber[n]; - int i = 0; - - printf(&quot;\n--- Enter Numbers ---\n&quot;); - - // Input Loop for numbers - while (i &lt; n) - { - printf(&quot;Enter number %d: &quot;, i + 1); - - if (scanf(&quot;%lf&quot;, &amp;inputNumber[i]) == 1) - { - // Clearing input buffer after successful read - while (getchar() != &#x27;\n&#x27;) - ; - i++; - } - else - { - printf(&quot;Invalid input. Only integers are allowed. Please try again.\n&quot;); - // Clearing input buffer to handle invalid input - while (getchar() != &#x27;\n&#x27; &amp;&amp; !feof(stdin)) - ; - } - } - - // 1. Sum Calculation - double tempSum = 0; - for (i = 0; i &lt; n; i++) - tempSum += inputNumber[i]; - - // 2. Average (Mean) calculation - double tempAverage = tempSum / n; - - // 3. Standard Deviation (Sample SD formula used) - double tempStandardDeviation = 0.0; - - // Preventing division by zero if n is 1. SD is 0 for a single number. - if (n &gt; 1) - { - double tempSumation = 0; - // calculating the sum of squared differences from the mean - for (i = 0; i &lt; n; i++) - tempSumation += pow((inputNumber[i] - tempAverage), 2.0); - - // Calculating sample standard deviation - tempStandardDeviation = sqrt(tempSumation / (n - 1)); - } - - // Assigning final values back to the variables in main(). - *sum = tempSum; - *average = tempAverage; - *standardDeviation = tempStandardDeviation; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem015-c', 'lucproblem015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem015.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem015.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem015-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program that defines a function that calculates power of one -number reaised to another and factorial value of a number in one cell. */ -/* Author - Amit Dutta, Date - 24th November, 2025 */ -/* Let Us C, Chap - 9, Page 159, Problem 9.2 */ - -#include &lt;stdio.h&gt; - -void bothPowerFactorial(double, int, int, double *, long long *); - -int main() -{ - double a, resultPower; - int b, factN; - long long resultFactorial; - printf(&quot;Enter a and b for calculating a raised to b: &quot;); - scanf(&quot;%lf %d&quot;, &amp;a, &amp;b); - printf(&quot;Enter number to calculate the factorial: &quot;); - scanf(&quot;%d&quot;, &amp;factN); - if (b &lt; 0 || factN &lt; 0) - { - printf(&quot;\nOnly non-negative integer is allowed as input of b and factorial.&quot;); - return 1; - } - bothPowerFactorial(a, b, factN, &amp;resultPower, &amp;resultFactorial); - printf(&quot;\n%g Raised to %d: %g&quot; - &quot;\nFactorial of %d: %lld&quot;, - a, b, resultPower, factN, resultFactorial); - return 0; -} - -void bothPowerFactorial(double a, int b, int n, double *resultPower, long long *resultFactorial) -{ - double tempResultPower = 1; - long long tempResultFactorial = 1; - int i; - - for (i = 1; i &lt;= b; i++) - tempResultPower *= a; - - for (i = 1; i &lt;= n; i++) - tempResultFactorial *= i; - - *resultPower = tempResultPower; - *resultFactorial = tempResultFactorial; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem016-c', 'lucproblem016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem016.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem016.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-letusc-lucproblem016-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Figure 9.4 shows three memory locations and values stored in them. -Write a program to declare variables that implement the relationship -shown. How will you print the values and addresses shown in the figure? -On which machine the program should be executed to get such addresses? - -Figure 9.4: - value: 3.14, memory_address: 7fff9489c79c - value: 7fff9489c7a0, memory_address: 7fff4fd134b8 - value: 7fff9489c79c, memory_address: 7fff9489c7a0 -*/ -/* Author - Amit Dutta, Date - 24th November, 2025 */ -/* Let Us C, Chap - 9, Page 160, Problem 9.3 */ - -#include &lt;stdio.h&gt; - -int main() -{ - float a = 3.14; - float *c = &amp;a; - float **b = &amp;c; - - printf(&quot;Location 1 (Variable a):\n&quot;); - printf(&quot;Value: %g\n&quot;, a); - printf(&quot;Address: %p\n&quot;, (void *)&amp;a); - printf(&quot;------------------------------\n&quot;); - - printf(&quot;Location 3 (Variable c: float *):\n&quot;); - printf(&quot;Value (Address stored): %p\n&quot;, (void *)c); - printf(&quot;Address of c itself: %p\n&quot;, (void *)&amp;c); - printf(&quot;Value pointed to (*c): %g\n&quot;, *c); - printf(&quot;------------------------------\n&quot;); - - printf(&quot;Location 2 (Variable b: float **):\n&quot;); - printf(&quot;Value (Address stored): %p\n&quot;, (void *)b); - printf(&quot;Address of b itself: %p\n&quot;, (void *)&amp;b); - printf(&quot;Value pointed to (*b): %p\n&quot;, (void *)*b); - printf(&quot;Value pointed to (**b): %g\n&quot;, **b); - printf(&quot;------------------------------\n&quot;); - - return 0; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <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" /> - </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">tuition-c</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-001-c', 'APC-PRAC-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate area and perimeter of a rectangle -by accepting length and breadth as input. */ -// Author - Amit Dutta, Date - 18th SEP, 2025 - -#include&lt;stdio.h&gt; -int main() { - double length, breadth, area, perimeter; - printf(&quot;Enter the length and breadth of the Rectangle : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;length, &amp;breadth); - area = length * breadth; - perimeter = 2 * (length + breadth); - printf(&quot;\nArea of the Rectangle : %g&quot; - &quot;\nPerimeter of the Rectangle : %g&quot;, area, perimeter); - return 0; - -} - -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-002-c', 'APC-PRAC-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate area of a circle using math library -method. Take radius of the circle as input. */ -/* Author - Amit Dutta, Date - 18th SEP, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double r, area; - printf(&quot;Enter the radius of the circle : &quot;); - scanf(&quot;%lf&quot;, &amp;r); - area = M_PI * pow(r, 2); - printf(&quot;\nArea of the circle : %g&quot;, area); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-003-c', 'APC-PRAC-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to accept diagonal of a square and calculate area, parimeter */ -/* Author - Amit Dutta, Date - 18th SEP, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double dia, side, area, peri; - printf(&quot;Enter the diagonal of the square : &quot;); - scanf(&quot;%lf&quot;, &amp;dia); - side = dia / sqrt(2); - area = pow(side, 2); - peri = 4 * side; - printf(&quot;\nArea of the square : %g&quot; - &quot;\nPerimeter of the square : %g&quot;, - area, peri); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-004-c', 'APC-PRAC-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate and display radius of a circle by taking the area as input. */ -/* Author - Amit Dutta, Date - 18th SEP, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double r, area; - printf(&quot;Enter the area of the circle : &quot;); - scanf(&quot;%lf&quot;, &amp;area); - r = sqrt(area / M_PI); - printf(&quot;\nRadius of the circle : %g&quot;, r); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-005-c', 'APC-PRAC-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP a program that accept number of days -as input and represent it as years, months and days. */ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int days, months, years, temp; - printf(&quot;Enter the No. of days : &quot;); - scanf(&quot;%d&quot;, &amp;days); - temp = days; - years = days / 365; - days = days % 365; - months = days / 30; - days = days % 30; - printf(&quot;%d Days = %d Years, %d Months, %d Days&quot;, temp, years, months, days); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-006-c', 'APC-PRAC-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP that accept seconds as input and represent it an hours, minutes and seconds. */ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int sec, hours, minutes, temp; - printf(&quot;Enter the no of seconds : &quot;); - scanf(&quot;%d&quot;, &amp;sec); - temp = sec; - hours = sec / 3600; - sec = sec % 3600; - minutes = sec / 60; - sec = sec % 60; - printf(&quot;\n%d Seconds = %d Hours, %d Minutes, %d Seconds.&quot;, temp, hours, minutes, sec); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-007-c', 'APC-PRAC-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP that accept basic salary of an employee and display gross salary, -net salary generated by below formula. - DA = 25% of the basic salary. - HRA = 12.5% of the basic salary. - PF = 10% of the basic salary. - gross salary = basic salary + da + hra - net salary = gross salary - pf -*/ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - double bs, gs, ns, da, hra, pf; - printf(&quot;Enter the basic salary of the employee : &quot;); - scanf(&quot;%lf&quot;, &amp;bs); - da = bs * 0.25; - hra = bs * 0.125; - pf = bs * 0.10; - gs = bs + da + hra; - ns = gs - pf; - printf(&quot;\nGross Salary : %g&quot; - &quot;\nNet Salary : %g&quot;, - gs, ns); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-008-c', 'APC-PRAC-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to multiply and divide a number by 4 without -using multiplication and division operator. */ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int num, multi, div; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - multi = num &lt;&lt; 2; - div = num &gt;&gt; 2; - printf(&quot;Multiplication : %d&quot; - &quot;\nDivision : %d&quot;, - multi, div); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-009-c', 'APC-PRAC-009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to swap two integer variable without using Third variable. */ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int a = 4, b = 6; - printf(&quot;Before swap : A = %d and B = %d&quot;, a, b); - a = a ^ b; - b = a ^ b; - a = a ^ b; - printf(&quot;\nAfter swap : A = %d and B = %d&quot;, a, b); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-010-c', 'APC-PRAC-010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate and display the valve of the given expression : - (1/a^3) + (1/(b+2)^3) + (1/(c^4 + root(2))) - take a, b, c as input. -*/ -/* Author - Amit Dutta, Date - 19th SEP, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - double a, b, c, result; - printf(&quot;Enter the value for a, b and c : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;a, &amp;b, &amp;c); - result = (1 / pow(a, 3)) + (1 / pow((b + 2), 3)) + (1 / (pow(c, 4) + sqrt(2))); - printf(&quot;\nResult = %g&quot;, result); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-011-c', 'APC-PRAC-011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-012-c', 'APC-PRAC-012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-013-c', 'APC-PRAC-013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-013.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-013.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-013-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-014-c', 'APC-PRAC-014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-014.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-014.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-014-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-015-c', 'APC-PRAC-015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-015.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-015.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-015-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to display all numbers between lb (lower bound) and up (upper bound) -which ends with digit 7 or divisible by 7. */ -/* Author - Amit Dutta, Date - 06th November, 2025 */ -// File Name - amit0611202501.c (LAB), APC-PRAC-015.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 lb, ub, i; - printf(&quot;Enter the lb, ub : &quot;); - scanf(&quot;%d %d&quot;, &amp;lb, &amp;ub); - printf(&quot;\nEnds with 7 :&quot;); - for (i = lb; i &lt;= ub; i++) - { - if (i % 10 == 7) - { - printf(&quot; %d&quot;, i); - } - } - printf(&quot;\nDivisible by 7 :&quot;); - for (i = lb; i &lt;= ub; i++) - { - if (i % 7 == 0) - { - printf(&quot; %d&quot;, i); - } - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-016-c', 'APC-PRAC-016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-016.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-016.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-016-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check palindrome number. */ -/* Author - Amit Dutta, Date - 06th November, 2025 */ -// File Name - amit0611202502.c (LAB), APC-PRAC-016.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, rev = 0; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - temp = num; - while (temp &gt; 0) - { - rev = (rev * 10) + (temp % 10); - temp /= 10; - } - if (rev == num) - printf(&quot;\nInput %d is a palindrome number.&quot;, num); - else - printf(&quot;\nInput %d is not a palindrome number.&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-017-c', 'APC-PRAC-017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-017.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-017.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-017-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check perfect number. */ -/* Author - Amit Dutta, Date - 06th November, 2025 */ -// File Name - amit0611202503.c (LAB), APC-PRAC-017.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, i, divisibleSum = 0; - printf(&quot;Enter a number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - for (i = 1; i &lt;= num / 2; i++) - { - if (num % i == 0) - { - divisibleSum += i; - } - } - if (divisibleSum == num) - printf(&quot;\nInput %d ia a Perfect Number.&quot;, num); - else - printf(&quot;\nInput %d is NOT a Perfect Number.&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-018-c', 'APC-PRAC-018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-018.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-018.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-018-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check Automorphic Number. */ -/* Author - Amit Dutta, Date - 06th November, 2025 */ -// File Name - amit0611202504.c (LAB), APC-PRAC-018.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; - -int main() -{ - int num, square, count = 0, temp, modNum; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - square = (int)pow(num, 2); - temp = num; - while (temp &gt; 0) - { - temp /= 10; - count++; - } - modNum = (int)pow(10, count); - temp = square % modNum; - if (num == temp) - printf(&quot;\nInput %d is a Automorphic Number.&quot;, num); - else - printf(&quot;\nInput %d is a Automorphic Number.&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-019-c', 'APC-PRAC-019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-019.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-019.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-019-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-020-c', 'APC-PRAC-020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-020.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-020.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-020-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-021-c', 'APC-PRAC-021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-021.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-021.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-021-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-022-c', 'APC-PRAC-022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-022.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-022.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-022-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-023-c', 'APC-PRAC-023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-023.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-023.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-023-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-024-c', 'APC-PRAC-024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-024.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-024.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-024-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 1 - 2 1 - 3 2 1 - 4 3 2 1 - 5 4 3 2 1 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202501.c (LAB), APC-PRAC-024.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = i; j &gt;= 1; j--) { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-025-c', 'APC-PRAC-025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-025.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-025.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-025-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 5 4 3 2 1 - 5 4 3 2 - 5 4 3 - 5 4 - 5 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202502.c (LAB), APC-PRAC-025.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = n; j &gt;= i; j--) { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-026-c', 'APC-PRAC-026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-026.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-026.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-026-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 5 - 5 4 - 5 4 3 - 5 4 3 2 - 5 4 3 2 1 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202503.c (LAB), APC-PRAC-026.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = n; i &gt;= 1; i--) { - for(j = n; j &gt;= i; j--) { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-027-c', 'APC-PRAC-027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-027.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-027.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-027-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 1 2 3 4 5 - 2 3 4 5 - 3 4 5 - 4 5 - 5 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202504.c (LAB), APC-PRAC-027.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = i; j &lt;= n; j++) { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-028-c', 'APC-PRAC-028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-028.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-028.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-028-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 1 - 2 3 - 4 5 6 - 7 8 9 10 - 11 12 13 14 15 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202505.c (LAB), APC-PRAC-028.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 n, i, j, temp = 1; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = 1; j &lt;= i; j++) { - printf(&quot;%d\t&quot;, temp); - temp++; - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-029-c', 'APC-PRAC-029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-029.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-029.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-029-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 1 - 1 0 - 1 0 1 - 1 0 1 0 - 1 0 1 0 1 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202506.c (LAB), APC-PRAC-029.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = 1; j &lt;= i; j++) { - if(j % 2 == 0) printf(&quot;0 &quot;); - else printf(&quot;1 &quot;); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-030-c', 'APC-PRAC-030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-030.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-030.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-030-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - # - @ @ - # # # - @ @ @ @ - # # # # # -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202507.c (LAB), APC-PRAC-030.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 n, i, j; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = 1; j &lt;= i; j++) { - if(i % 2 == 0) printf(&quot;@ &quot;); - else printf(&quot;# &quot;); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-031-c', 'APC-PRAC-031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-031.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-031.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-031-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - 1 2 3 4 5 - 6 7 8 9 - 10 11 12 - 13 14 - 15 -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202508.c (LAB), APC-PRAC-031.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 n, i, j, temp = 1; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = n; i &gt;= 1; i--) { - for(j = 1; j &lt;= i; j++) { - printf(&quot;%d\t&quot;, temp); - temp++; - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-032-c', 'APC-PRAC-032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-032.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-032.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-032-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Pattern: - A - B B - C C C - D D D D - E E E E E -*/ -/* Author = Amit Dutta, Date - 13th November, 2025 */ -// File Name - amit1311202509.c (LAB), APC-PRAC-032.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 n, i, j; char temp = &#x27;A&#x27;; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for(i = 1; i &lt;= n; i++) { - for(j = 1; j &lt;= i; j++) { - printf(&quot;%c\t&quot;, temp); - } - temp++; - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-033-c', 'APC-PRAC-033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-033.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-033.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-033-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Print the factorial of the digits off a number */ -/* Auhtor: Amit Dutta, Date: 20-11-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 factorial(int); - -int factorial(int n) -{ - int i, fact = 1; - for (i = 1; i &lt;= n; i++) - fact *= i; - return fact; -} - -int main() -{ - int n, temp; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (n &lt; 0) - { - printf(&quot;Only non-negetive number is allowed.&quot;); - return 1; - } - temp = n; - while (temp &gt; 0) - { - printf(&quot;\nFactorial of %d: %d&quot;, temp % 10, factorial(temp % 10)); - temp /= 10; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-034-c', 'APC-PRAC-034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-034.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-034.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-034-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Take a Range as input from user and print the prime number between it. */ -/* Auhtor: Amit Dutta, Date: 20-11-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; -#include &lt;math.h&gt; - -int isPrime(int); - -int isPrime(int n) -{ - if (n &lt;= 1) - return 0; - if (n == 2) - return 1; - if (n % 2 == 0) - return 0; - int temp = (int)sqrt(n), i; - for (i = 3; i &lt;= temp; i += 2) - if (n % i == 0) - return 0; - return 1; -} - -int main() -{ - int lb, ub, i; - printf(&quot;Enter the lower bound and the upper bound: &quot;); - scanf(&quot;%d %d&quot;, &amp;lb, &amp;ub); - printf(&quot;\nPrime numbers between %d and %d: &quot;, lb, ub); - for (i = lb; i &lt;= ub; i++) - if (isPrime(i)) - printf(&quot;%d &quot;, i); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-035-c', 'APC-PRAC-035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-035.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-035.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-035-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Print all the 3 and 4 digit palindrome number. */ -/* Auhtor: Amit Dutta, Date: 20-11-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 palindromeCheck(int); - -int palindromeCheck(int n) -{ - int temp = n, rev = 0; - while (temp &gt; 0) - { - rev = (rev * 10) + (temp % 10); - temp /= 10; - } - if (rev == n) - return 1; - else - return 0; -} - -int main() -{ - int i; - printf(&quot;Palindrome number of 3 and 4 digits: &quot;); - for (i = 100; i &lt;= 9999; i++) - if (palindromeCheck(i)) - printf(&quot;%d &quot;, i); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-036-c', 'APC-PRAC-036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-036.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-036.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-036-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Check krishnamurty number. */ -/* Auhtor: Amit Dutta, Date: 20-11-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 factorial(int); -int checkKrishnamurty(int); - -int factorial(int n) -{ - int i, fact = 1; - for (i = 1; i &lt;= n; i++) - fact *= i; - return fact; -} - -int checkKrishnamurty(int n) -{ - int temp1 = n, temp2 = 0; - while (temp1 &gt; 0) - { - temp2 += factorial(temp1 % 10); - temp1 /= 10; - } - if (temp2 == n) - return 1; - else - return 0; -} - -int main() -{ - int n; - printf(&quot;Enter the number: &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (checkKrishnamurty(n)) - printf(&quot;\nInput %d is a Krishnamurty number.&quot;, n); - else - printf(&quot;\ninput %d is not a Krishnamurty number.&quot;, n); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-037-c', 'APC-PRAC-037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-037.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-037.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-037-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Show all the armstrong number between a range. */ -/* Author: Amit Dutta, Date: 21-11-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; -#include &lt;math.h&gt; - -#define lowerBound 100 -#define upperBound 999 - -int isArmstrongNumber(int); - -int isArmstrongNumber(int n) -{ - int temp = n, sum = 0, count = 0; - while (temp &gt; 0) - { - count++; - temp /= 10; - } - temp = n; - while (temp &gt; 0) - { - sum += (int)pow(temp % 10, count); - temp /= 10; - } - return sum == n; -} - -int main() -{ - int n, i, count = 0; - printf(&quot;Armstrong number between %d and %d are: &quot;, lowerBound, upperBound); - for (i = lowerBound; i &lt;= upperBound; i++) - if (isArmstrongNumber(i)) - { - printf(&quot;%d &quot;, i); - count++; - } - printf(&quot;\n\nCount: %d\n&quot;, count); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-038-c', 'APC-PRAC-038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-038.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-038.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-038-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Print all combinations of two two-digit numbers such that the sum of digits of both numbers is equal. -Example: 23 and 41 → (2+3) = 5, (4+1) = 5. -*/ -/* Author: Amit Dutta, Date: 21-11-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() -{ - printf(&quot;Combinations of two two-digit numbers such that the sum of digits of both numbers is equal: &quot;); - int i, j, sum1, sum2, count = 0; - for (i = 10; i &lt;= 99; i++) - { - sum1 = (i % 10) + (i / 10); - for (j = i + 1; j &lt;= 99; j++) - { - sum2 = (j % 10) + (j / 10); - if (sum1 == sum2) - { - printf(&quot;(%d, %d) &quot;, i, j); - count++; - } - } - } - printf(&quot;\nCount: %d\n&quot;, count); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-039-c', 'APC-PRAC-039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-039.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-039.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-039-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Write a C program to print all unique combinations of three numbers (a, b, c) such that: -1 ≤ a, b, c ≤ 30 and a² + b² = c² (Pythagorean triplets) -*/ -/* Author: Amit Dutta, Date: 21-11-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() -{ - printf(&quot;a² + b² = c² : &quot;); - int i, j, k, sq1, sq2, count = 0; - for (i = 1; i &lt;= 30; i++) - { - sq1 = i * i; - for (j = i + 1; j &lt;= 30; j++) - { - sq2 = j * j; - for (k = j + 1; k &lt;= 30; k++) - { - if (sq1 + sq2 == k * k) - { - printf(&quot;(%d, %d, %d) &quot;, i, j, k); - count++; - } - } - } - } - printf(&quot;\n\nCount: %d\n&quot;, count); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-040-c', 'APC-PRAC-040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-040.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-040.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-040-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Write a C program to count how many numbers between 100 and 999 have all distinct digits (e.g., 123, 709, 981). -*/ -/* Author: Amit Dutta, Date: 21-11-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() -{ - int i, count = 0, n1, n2, n3; - printf(&quot;Distinct numbers between 100 and 999: &quot;); - for (i = 100; i &lt;= 999; i++) - { - n1 = i / 100; - n2 = (i % 100) / 10; - n3 = i % 10; - if (n1 != n2 &amp;&amp; n2 != n3 &amp;&amp; n1 != n3) - { - printf(&quot;%d &quot;, i); - count++; - } - } - printf(&quot;\nCount: %d\n&quot;, count); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-041-c', 'APC-PRAC-041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-041.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-041.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-041-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* -Write a C program to find and print all twin prime pairs between 1 and n using nested loops. -(Twin primes are prime numbers having a difference of 2, like 11 and 13) -*/ -/* Author: Amit Dutta, Date: 21-11-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; -#include &lt;math.h&gt; - -int isPrime(int n) -{ - if (n &lt; 2) - return 0; - if (n == 2) - return 1; - if (n % 2 == 0) - return 0; - int i, temp = (int)sqrt(n); - for (i = 3; i &lt;= temp; i += 2) - if (n % i == 0) - return 0; - return 1; -} - -int main() -{ - int n, i, count = 0; - printf(&quot;enter the n: &quot;); - scanf(&quot;%d&quot;, &amp;n); - printf(&quot;\nAll the twin numbers: &quot;); - for (i = 1; i &lt;= n - 2; i++) - { - if (isPrime(i)) - { - if (isPrime(i + 2)) - { - printf(&quot;(%d, %d) &quot;, i, i + 2); - count++; - } - } - } - printf(&quot;\nCount; %d&quot;, count); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-042-c', 'APC-PRAC-042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-042.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-042.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-PRAC-042-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a function to check whether a given string is a palindrome. Use this function to -determine whether an entered string is Palindrome. */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -int isPalindrome(char[]); - -int main() -{ - char input[100]; - int len; - - printf(&quot;Enter the string (Max: 100 Character): &quot;); - fgets(input, sizeof(input), stdin); - len = strlen(input); - - if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) - { - input[len - 1] = &#x27;\0&#x27;; - } - - if (isPalindrome(input)) - { - printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); - } - else - { - printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); - } - - return 0; -} - -int isPalindrome(char str[]) -{ - char *start = str; - char *end; - int len = strlen(str); - - if (len == 0) - { - return 1; - } - - end = str + (len - 1); - - while (start &lt; end) - { - if (*start != *end) - { - return 0; - } - start++; - end--; - } - - return 1; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-001-c', 'APC-S-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -#include&lt;stdio.h&gt; -int main() { - int a = 9, b = 4, c; - c = a + b; - printf(&quot;A + B = %d\n&quot;, c); - c = a / b; - printf(&quot;A / B = %d\n&quot;, c); - c = a % b; - printf(&quot;A %% B = %d\n&quot;, c); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-002-c', 'APC-S-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -#include&lt;stdio.h&gt; -int main() { - int a = 5, b = 5, c = 10; - printf(&quot;a = b = %d\n&quot;, a == b); - printf(&quot;a &gt; b = %d\n&quot;, a &gt; b); - printf(&quot;a &lt; b = %d\n&quot;, a &lt; b); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-003-c', 'APC-S-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -#include &lt;stdio.h&gt; -int main() { - int a = 5, b = 5, c = 10, result; - - result = (a == b) &amp;&amp; (c &gt; b); - printf(&quot;Result is %d\n&quot;, result); - - result = (a == b) &amp;&amp; (c &lt; b); - printf(&quot;Result is %d\n&quot;, result); - - result = (a != b) || (c &lt; b); - printf(&quot;Result is %d\n&quot;, result); - - result = (a != b) || (c &lt; b); - printf(&quot;Result is %d\n&quot;, result); - - result = !(a != b); - printf(&quot;Result is %d\n&quot;, result); - - result = !(a == b); - printf(&quot;Result is %d\n&quot;, result); - - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-004-c', 'APC-S-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Program to print first 10 natural numbers using while loop. */ -/* Author - Amit Dutta, Date - 29th October, 2025 */ - -/* - * Compiler Note: This source code is specifically designed for compilation - * and execution within the ** Turbo C ** environment. - * - * Testing Disclaimer: Due to a lack of access to the required Turbo C - * compiler software, this code has not been formally compiled or tested. - */ - -#include &lt;stdio.h&gt; -#include &lt;conio.h&gt; - -void main() -{ - clrscr(); - int x; - x = 1; - while (x &lt;= 10) - { - printf(&quot;%d &quot;, x); - x++; - } - getch(); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-005-c', 'APC-S-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write to reverse a number. */ -/* Author - Amit Dutta, Date - 29th October, 2025 */ - -/* - * Compiler Note: This source code is specifically designed for compilation - * and execution within the ** Turbo C ** environment. - * - * Testing Disclaimer: Due to a lack of access to the required Turbo C - * compiler software, this code has not been formally compiled or tested. - */ - -#include &lt;stdio.h&gt; -#include &lt;conio.h&gt; - -void main() -{ - clrscr(); - int n, reverse = 0, rem; - printf(&quot;Enter the numner : &quot;); - scanf(&quot;%d&quot;, &amp;n); - while (n != 0) - { - rem = n % 10; - reverse = reverse * 10 + rem; - n /= 10; - } - printf(&quot;Reversed Number : %d&quot;, reverse); - getch(); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-006-c', 'APC-S-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print first 10 multiple of 5 */ -/* Author - Amit Dutta, Date - 29th October, 2025 */ - -/* - * Compiler Note: This source code is specifically designed for compilation - * and execution within the ** Turbo C ** environment. - * - * Testing Disclaimer: Due to a lack of access to the required Turbo C - * compiler software, this code has not been formally compiled or tested. - */ - -#include &lt;stdio.h&gt; -#include &lt;conio.h&gt; - -void main() -{ - clrscr(); - int a = 5, i = 1, res; - while (i &lt;= 10) - { - res = a * i; - printf(&quot;%d * %d = %d\n&quot;, a, i, res); - i++; - } - getch(); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-007-c', 'APC-S-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program the sum of first 10 natural numbers. */ -/* Author - Amit Dutta, Date - 29th October, 2025 */ - -/* - * Compiler Note: This source code is specifically designed for compilation - * and execution within the ** Turbo C ** environment. - * - * Testing Disclaimer: Due to a lack of access to the required Turbo C - * compiler software, this code has not been formally compiled or tested. - */ - -#include &lt;stdio.h&gt; -#include &lt;conio.h&gt; - -void main() -{ - clrscr(); - int i, sum = 0; - for (i = 1; i &lt;= 10; i++) - { - sum += i; - } - printf(&quot;\nSum of the first natural number : %d&quot;, sum); - getch(); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-008-c', 'APC-S-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print the sum of two matrix as input given by the user. */ -/* Author: Amit Dutta, Date: 18-11-2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int rows, cols, i, j; - printf(&quot;Enter the number of rows and columns: &quot;); - scanf(&quot;%d %d&quot;, &amp;rows, &amp;cols); - - int a[rows][cols], b[rows][cols], c[rows][cols]; - - printf(&quot;Enter the elements of matrix A (%d x %d): \n&quot;, rows, cols); - for (i = 0; i &lt; rows; i++) - for (j = 0; j &lt; cols; j++) - { - printf(&quot;Position %d%d: &quot;, i, j); - scanf(&quot;%d&quot;, &amp;a[i][j]); - } - printf(&quot;\nMatrix A: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - printf(&quot;%d &quot;, a[i][j]); - printf(&quot;\n&quot;); - } - - printf(&quot;\nEnter the elements of matrix B(%d x %d): \n&quot;, rows, cols); - for (i = 0; i &lt; rows; i++) - for (j = 0; j &lt; cols; j++) - { - printf(&quot;Position %d%d: &quot;, i, j); - scanf(&quot;%d&quot;, &amp;b[i][j]); - } - printf(&quot;\nMatrix B: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - printf(&quot;%d &quot;, b[i][j]); - printf(&quot;\n&quot;); - } - - for (i = 0; i &lt; rows; i++) - for (j = 0; j &lt; cols; j++) - c[i][j] = a[i][j] + b[i][j]; - - printf(&quot;\nResult Matrix: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - printf(&quot;%d &quot;, c[i][j]); - printf(&quot;\n&quot;); - } - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-009-c', 'APC-S-009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the upper and lower triangular matrix. */ -/* Author: Amit Dutta, Date: 18-11-2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, rows, cols; - printf(&quot;\nEnter the number of rows and columns : &quot;); - scanf(&quot;%d %d&quot;, &amp;rows, &amp;cols); - - if (rows != cols) - { - printf(&quot;Triangular matrix definitions only apply to square matrices (rows == columns).\n&quot;); - return 1; - } - - int matrix[rows][cols]; - - printf(&quot;Enter the elements of matrix (%d x %d): \n&quot;, rows, cols); - for (i = 0; i &lt; rows; i++) - for (j = 0; j &lt; cols; j++) - { - printf(&quot;Position %d%d: &quot;, i, j); - scanf(&quot;%d&quot;, &amp;matrix[i][j]); - } - printf(&quot;\nMatrix: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - printf(&quot;%d &quot;, matrix[i][j]); - printf(&quot;\n&quot;); - } - - printf(&quot;\nUpper triangular of the Matrix: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - { - if (j &gt;= i) - printf(&quot;%d &quot;, matrix[i][j]); - else - printf(&quot;~ &quot;); - } - printf(&quot;\n&quot;); - } - - printf(&quot;\nLower triangular of the Matrix: \n&quot;); - for (i = 0; i &lt; rows; i++) - { - for (j = 0; j &lt; cols; j++) - { - if (j &lt;= i) - printf(&quot;%d &quot;, matrix[i][j]); - else - printf(&quot;~ &quot;); - } - printf(&quot;\n&quot;); - } - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-010-c', 'APC-S-010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to input a new element at a specific position of an array. - a[] = {4, 5, 2, 10, 6, 9, 8}, newItem = 7, position = 3 -*/ -/* Author: Amit Dutta, Date: 18-11-2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int a[8] = {4, 5, 2, 10, 6, 9, 8}; - int i; - - printf(&quot;Elemnts of the array: &quot;); - for (i = 0; i &lt;= 6; i++) - printf(&quot;%d &quot;, a[i]); - - printf(&quot;\nMethod 1: &quot;); - for (i = 7; i &gt;= 4; i--) - a[i] = a[i - 1]; - a[3] = 7; - for (i = 0; i &lt;= 7; i++) - printf(&quot;%d &quot;, a[i]); - - // another method - printf(&quot;\nMethod 2: &quot;); - int b[8] = {4, 5, 2, 10, 6, 9, 8}; - int temp1 = 7; - for (i = 3; i &lt;= 7; i++) - { - int temp2 = b[i]; - b[i] = temp1; - temp1 = temp2; - } - for (i = 0; i &lt;= 7; i++) - printf(&quot;%d &quot;, b[i]); - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-011-c', 'APC-S-011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Linear search */ -/* Author: Amit Dutta, Date: 19-11-2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int elementCount, i, keyElement; - - printf(&quot;Enter the number of element you want to add: &quot;); - scanf(&quot;%d&quot;, &amp;elementCount); - - int elements[elementCount]; - - for (i = 0; i &lt; elementCount; i++) - { - printf(&quot;Enter Element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;elements[i]); - } - - printf(&quot;\nEnter the Key Element you want to search: &quot;); - scanf(&quot;%d&quot;, &amp;keyElement); - for (i = 0; i &lt; elementCount; i++) - if (elements[i] == keyElement) - { - printf(&quot;\nKey Element %d is found in %d position.&quot;, keyElement, i); - return 0; - } - printf(&quot;\nKey Element %d is not found.&quot;, keyElement); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-012-c', 'APC-S-012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check if a matrix is a sparx matrix. */ -/* Author: Amit Dutta, Date: 19-11-2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, row, col, count = 0; - - printf(&quot;Enter the number of rows and columns in the matrix: &quot;); - scanf(&quot;%d %d&quot;, &amp;row, &amp;col); - - int matrix[row][col]; - - for (i = 0; i &lt; row; i++) - for (j = 0; j &lt; col; j++) - { - printf(&quot;Postion %d%d: &quot;, i, j); - scanf(&quot;%d&quot;, &amp;matrix[i][j]); - if (matrix[i][j] == 0) - count++; - } - - printf(&quot;\nEntered Matrix: \n&quot;); - for (i = 0; i &lt; row; i++) - { - for (j = 0; j &lt; col; j++) - printf(&quot;%d &quot;, matrix[i][j]); - printf(&quot;\n&quot;); - } - - if (count &gt; (row * col) / 2) - printf(&quot;\nEntered matrix is a Sparx Matrix.&quot;); - else - printf(&quot;\nEntered matrix is not a Sparx Matrix&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-013-c', 'APC-S-013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-013.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-013.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-013-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a fuction to calculate the average of an array */ -/* Author: Amit Dutta, Date: 26-11-2025 */ - -#include &lt;stdio.h&gt; - -double average(int []); - -int main() -{ - int marks[10], i; - printf(&quot;\nEnter 10 numbers: \n&quot;); - for (i = 0; i &lt;= 9; i++) - { - printf(&quot;Enter number %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;marks[i]); - } - printf(&quot;\nAverage = %g&quot;, average(marks)); - return 0; -} - -double average(int marks[10]) -{ - int sum = 0; - for (int i = 0; i &lt;= 9; i++) - sum += marks[i]; - return sum / 10.0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-014-c', 'APC-S-014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-014.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-014.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-S-014-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to store roll no, name and marks of 5 students then print it. use structure */ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -struct student -{ - int roll_no; - char name[30]; - float marks; -}; - -int main() -{ - int i, stu_count = 3; - struct student s[stu_count]; - for (i = 0; i &lt; stu_count; i++) - { - printf(&quot;\nEnter the Roll Number: &quot;); - scanf(&quot;%d&quot;, &amp;s[i].roll_no); - getchar(); - printf(&quot;Enter the name: &quot;); - gets(s[i].name); - printf(&quot;Enter the Marks: &quot;); - scanf(&quot;%f&quot;, &amp;s[i].marks); - } - printf(&quot;\n%-10s %-20s %-10s\n&quot;, &quot;ROLL&quot;, &quot;NAME&quot;, &quot;MARKS&quot;); - printf(&quot;%-10s %-20s %-10s\n&quot;, &quot;====&quot;, &quot;====&quot;, &quot;=====&quot;); - for (i = 0; i &lt; stu_count; i++) - { - printf(&quot;%-10d %-20s %-10.2f\n&quot;, s[i].roll_no, s[i].name, s[i].marks); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-001-c', 'APC-SPS-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -// WAP to perform arithmatic operation on integer data - -#include&lt;stdio.h&gt; -int main() { - int a, b, sum, sub, multi, div, mod; - printf(&quot;Enter 1st number : &quot;); - scanf(&quot;%d&quot;, &amp;a); - printf(&quot;Enter 2nd number : &quot;); - scanf(&quot;%d&quot;, &amp;b); - sum = a + b; - sub = a - b; - multi = a * b; - div = a / b; - mod = a % b; - printf(&quot;\nSum = %d&quot;, sum); - printf(&quot;\nSubtraction = %d&quot;, sub); - printf(&quot;\nMultiplication = %d&quot;, multi); - printf(&quot;\nDivision = %d&quot;, div); - printf(&quot;\nModulas = %d&quot;, div); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-002-c', 'APC-SPS-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to swap two integers. Display both numbers -before and after swap */ - -#include&lt;stdio.h&gt; -int main() { - int a = 10, b = 20, temp; - printf(&quot;Before swap A : %d, B : %d&quot;, a, b); - temp = a; - a = b; - b = temp; - printf(&quot;\nAfter swap A : %d, B : %d&quot;, a, b); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-003-c', 'APC-SPS-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Bitwise AND &#x27;&amp;&#x27; */ - -#include&lt;stdio.h&gt; -int main() { - unsigned int a = 4, b = 5, c = 6; - unsigned int x, y; - x = a &amp; b; - y = b &amp; c; - printf(&quot;x = %u y = %u&quot;, x, y); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-004-c', 'APC-SPS-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -#include&lt;stdio.h&gt; -int main() { - int x = 25, y = 19, z; - z = x - y; - z = z &amp; x ; - printf(&quot;Z = %d&quot;, z); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-005-c', 'APC-SPS-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Bitwise OR &#x27;|&#x27; */ - -#include&lt;stdio.h&gt; -int main() { - int x = 12, y = 14, z = 10, res; - x++; - z++; - x = x + y + z; - res = x | y; - z = res | z; - printf(&quot;x = %d y = %d z = %d res = %d&quot;, x, y, z, res); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-006-c', 'APC-SPS-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Bitwise NOT &#x27;~&#x27; */ - -#include&lt;stdio.h&gt; -int main() { - int x = 12, y = 15, z = 21; - int res, res1, res2; - res = x &gt; 10; - res1 = ~res; - res2 = ~x; - printf(&quot;REs = %d, Res1 = %d, Res2 = %d&quot;, res, res1, res2); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-007-c', 'APC-SPS-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to check a number is even or odd using bitwise operator */ - -#include&lt;stdio.h&gt; -int main() { - int x, res = 1; - printf(&quot;Enter a number : &quot;); - scanf(&quot;%d&quot;, &amp;x); - res = res &amp; x; - if (res == 0) { - printf(&quot;\nInput %d is a even number.&quot;, x); - } - else { - printf(&quot;\nInput %d is a odd number.&quot;, x); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-008-c', 'APC-SPS-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-APC-SPS-008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate area of circle by accepting radius as input */ -/* Author : Amit Dutta, Date : 15th September, 2025 */ - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double r, area; - printf(&quot;Enter the radius of circle : &quot;); - scanf(&quot;%lf&quot;, &amp;r); - area = M_PI * r * r; - printf(&quot;\nArea : %lf&quot;, area); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P001-c', 'P001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -//sample code -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - printf(&quot;Hello world&quot;); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P002-c', 'P002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -//sample code with a new line charecter -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - printf(&quot;Hello\nworld&quot;); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P003-c', 'P003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -//WAP to perform addtion and multiplication of two integer numbers -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - int a, b, sum, multi; - printf(&quot;Enter the 1st number : &quot;); - scanf(&quot;%d&quot;,&amp;a); - printf(&quot;Enter the 2nd number : &quot;); - scanf(&quot;%d&quot;,&amp;b); - sum = a + b; - multi = a * b; - printf(&quot;\nSum = %d&quot; - &quot;\nMultiplication = %d&quot;,sum,multi); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P004-c', 'P004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to find and display the value of given expression : -((x+3)/4) - ((2x+4)/3) taking the value of x = 5 */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - double x =5, result; - result = ((x + 3) / 4) - ((2 * x + 4) / 3); - printf(&quot;Result = %lf&quot;,result); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P005-c', 'P005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A person is paid Rs. 455 for each day he works and fined -Rs. 150 for each day he remains absent. WAP to calculate his -monthly income taking the number of days present as input. */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - int daily_wage = 455, fine = 150, present, absent, income; - printf(&quot;No of days present : &quot;); - scanf(&quot;%d&quot;, &amp;present); - absent = 30 - present; - income = (present * 455) - (absent * 150); - printf(&quot;\nIncome : %d&quot;,income); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P006-c', 'P006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* The normal temperature of human body -is 98.6 Degree Fahrenheit. WAP to convert the temperature -to Degree Celcius and display the output. */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - double f = 98.6, c; - c = ((f - 32) * 5) / 9; - printf(&quot;Temperature in Celcius is : %lf&quot;,c); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P007-c', 'P007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A shopkeeper offers 10% discount on printed -price of a digital camera. However a customer has -to pay 6% GST on the remaining amount. WAP to -calculate and display the amount to paid by the -customer, taking the printed price as input. */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - double mrp, final_price, temp; - printf(&quot;Enter the printed price : &quot;); - scanf(&quot;%lf&quot;, &amp;mrp); - temp = mrp * 0.90; - final_price = temp * 1.06; - printf(&quot;\nCustomer have to pay : %lf&quot;, final_price); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P008-c', 'P008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* A shopkeeper offers 30% discount on purchasing an -item whereas the other shopkeeper offers 2 successive -discount of 20% and 10% for purchasing the same item. -WAP to caompute and display the discounted price of the -item by taking the price as input. */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - double mrp, shop1, shop2, temp; - printf(&quot;Enter the price : &quot;); - scanf(&quot;%lf&quot;, &amp;mrp); - shop1 = mrp * 0.70; - temp = mrp * 0.80; - shop2 = temp * 0.90; - printf(&quot;\nShopkeeper 1 price : %lf&quot; - &quot;\nShopkeeper 2 price : %lf&quot;,shop1,shop2); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P009-c', 'P009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate gross and net salary -by accepting basic salary as input. -IMP : DA = 30% of Basic Pay - HRA = 20% of Basic Pay - PF = 12.5% of Basic Pay - Gross Salary = Basic Pay + DA + HRA - Net Salary = Gross Salary - PF -*/ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - double bs, da, hra, pf, gs, ns; - printf(&quot;Enter the Basic Salary : &quot;); - scanf(&quot;%lf&quot;, &amp;bs); - da = bs * 0.3; - hra = bs * 0.2; - pf = bs * 0.125; - gs = bs + da + hra; - ns = gs - pf; - printf(&quot;\nGross Salary : %lf&quot; - &quot;\nNet Salary : %lf&quot;, gs, ns); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P010-c', 'P010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to find and display the difference -between compound Interest and Simple Interest. -Take principle amount as input. -Hint : si = (p * r * t) / 100 - a = p * ((1 + (r / 100)) ^ t) - ci = a - p -*/ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double p, r, t, si, a, ci, dif; - printf(&quot;Enter the principle amount, rate of interest, time in year : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;p, &amp;r, &amp;t); - si = (p * r * t) / 100; - a = p * pow((1 + (r / 100)), t); - ci = a - p; - dif = ci - si; - printf(&quot;\nSimple Interest : %lf&quot; - &quot;\nCompound Interest : %lf&quot; - &quot;\nInterest Difference : %lf&quot;, si, ci, dif); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P011-c', 'P011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* The time period of a simple pendulam is -given by the formula : - t = 2 * pi * square_root(l / g) -WAP to calculate T take length(L) and gravity -as input -*/ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double l, g, t; - printf(&quot;Enter the Length and Gravity measures : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;l, &amp;g); - t = 2 * M_PI * sqrt(l / g); - // using M_PI variable for PI value from math.h header file - printf(&quot;\nTime Period : %lf&quot;, t); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P012-c', 'P012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to swap two integer variable without -using third variable */ -// using Approch Mode : simple, slow, time consuming -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - int a = 4, b = 6; - printf(&quot;Before Swap : A = %d, B = %d&quot;, a, b); - a = a + b; - b = a - b; - a = a - b; - printf(&quot;\nAfter Swap : A = %d, B = %d&quot;, a, b); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P013-c', 'P013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P013.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P013.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P013-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to swap two integer variable without -using third variable */ -// using Approch Mode : complex, fast, less time consumimg -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - int a = 4, b = 6; - printf(&quot;Before Swap : A = %d, B = %d&quot;, a, b); - a = a ^ b; - b = a ^ b; - a = a ^ b; - printf(&quot;\nAfter Swap : A = %d, B = %d&quot;, a, b); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P014-c', 'P014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P014.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P014.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P014-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to accept the diagonal of -square. Find and display the area and -perimeter of the square. */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double d, side, area, per; - printf(&quot;Enter the diagonal : &quot;); - scanf(&quot;%lf&quot;, &amp;d); - side = d / sqrt (2); - area = side * side; - per = 4 * side; - printf(&quot;\nArea of the Square : %lf&quot; - &quot;\nPerimeter of the Square : %lf&quot;, area, per); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P015-c', 'P015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P015.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P015.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P015-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/*WAP to accept number of days and -display it after converting into -number of years, months and days */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -int main() { - int day, month, year, temp; - printf(&quot;Enter the number of days : &quot;); - scanf(&quot;%d&quot;, &amp;day); - temp = day; - year = day / 365; - day = day % 365; - month = day / 30; - day = day % 30; - printf(&quot;\n%d Days = %d Years %d Months %d Days&quot;, temp, year, month, day); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P016-c', 'P016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P016.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P016.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P016-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate and display radius of a -circle by taking the area as input */ -// Author - Amit Dutta, Date - Unknown - -#include&lt;stdio.h&gt; -#include&lt;math.h&gt; -int main() { - double area, r; - printf(&quot;Enter the area of a circle : &quot;); - scanf(&quot;%lf&quot;, &amp;area); - r = sqrt((7 * area) / 22); - printf(&quot;\nRadius : %lf&quot;, r); - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P017-c', 'P017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P017.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P017.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P017-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Find maximum between three number. */ -// Author - Amit Dutta, Date - Unknown - -#include &lt;stdio.h&gt; -int main() -{ - int a, b, c, max; - printf(&quot;Enter the value for a, b, c : &quot;); - scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); - max = a; - if (max &lt; b) - max = b; - if (max &lt; c) - max = c; - printf(&quot;Maximum : %d&quot;, max); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P018-c', 'P018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P018.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P018.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P018-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input the cost price and selling price and -calculate profit, profit percentage, loss percentage or -display the manage nither profit nor loss. */ -// Author - Amit Dutta, Date - Unknown - -#include &lt;stdio.h&gt; -int main() -{ - double cost, sell, pro, prop, loss, lossp; - printf(&quot;Enter the cost and selling price : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;cost, &amp;sell); - if (sell &gt; cost) - { - pro = sell - cost; - prop = (pro / cost) * 100; - printf(&quot;Profit : RS %g, Profit Percentage : %g&quot;, pro, prop); - } - else if (sell &lt; cost) - { - loss = cost - sell; - lossp = (loss / cost) * 100; - printf(&quot;Loss : RS %g, Loss Percentage : %g&quot;, loss, lossp); - } - else - printf(&quot;Neither loss nor Profit.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P019-c', 'P019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P019.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P019.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P019-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input the distance covered and calculate -the amount to be paid by the passanger. - Distance Rate - =&lt;5KM RS 90 - next 10KM RS 20/KM - next 10KM RS 10/KM - more than 25KM RS 9/KM -*/ -// Author - Amit Dutta, Date - Unknown - -#include &lt;stdio.h&gt; -int main() -{ - double dis, amt; - printf(&quot;Enter the distance : &quot;); - scanf(&quot;%lf&quot;, &amp;dis); - if (dis &lt;= 5.0) - amt = 90.0; - else if (dis &gt; 5.0 &amp;&amp; dis &lt;= 15.0) - amt = 90.0 + (dis - 5.0) * 20; - else if (dis &gt; 15.0 &amp;&amp; dis &lt;= 25.0) - amt = 90.0 + 200.0 + (dis - 15.0) * 10; - else if (dis &gt; 25.0) - amt = 90.0 + 200.0 + 100.0 + (dis - 25.0) * 9; - printf(&quot;\nAmount to be paid : %g&quot;, amt); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P020-c', 'P020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P020.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P020.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P020-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate and display the maturity amount -taking the sum and number of days as input. - No. of Days Rate of Interest - Upto 180 days 5.5 % - 181 to 364 days 7.5 % - exact 365 days 9.0 % - more than 365 days 8.5 % -*/ -// Author - Amit Dutta, Date - Unknown - -#include &lt;stdio.h&gt; -int main() -{ - double nod, amt, s, i; - printf(&quot;Enter the amount and the time in days : &quot;); - scanf(&quot;%lf %lf&quot;, &amp;s, &amp;nod); - if (nod &lt;= 180) - i = (s * 5.5 * (nod / 365)) / 100; - else if (nod &gt; 180.0 &amp;&amp; nod &lt;= 364.0) - i = (s * 7.5 * (nod / 365)) / 100; - else if (nod == 365.0) - i = (s * 9.0 * 1) / 100; - else if (nod &gt; 365.0) - i = (s * 8.5 * (nod / 365)) / 100; - amt = s + i; - printf(&quot;Amount to be paid : %g&quot;, amt); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P021-c', 'P021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P021.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P021.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P021-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input a positive number and check if it is a perfect -square number or not. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -int main() -{ - int n, temp; - double sr; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - sr = sqrt(n); - temp = (int)sr; - if (temp * temp == n) - printf(&quot;\nThis is a perfect square.&quot;); - else - printf(&quot;\nThis is not a perfect square.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P022-c', 'P022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P022.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P022.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P022-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to find out smallest of three numbers without using if_else block. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -int main() -{ - int a, b, c, min; - printf(&quot;Enter three number : &quot;); - scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); - min = (a &lt; b &amp;&amp; a &lt; c) ? a : (b &lt; a &amp;&amp; b &lt; c) ? b - : c; - printf(&quot;Minimum = %d&quot;, min); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P023-c', 'P023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P023.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P023.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P023-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input the total cost and compute the amount to be paid -by the customer. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -int main() -{ - double cost, amt; - printf(&quot;Enter the total cost : &quot;); - scanf(&quot;%lf&quot;, &amp;cost); - if (cost &lt;= 2000) - amt = cost * 0.94; - else if (cost &gt; 2000 &amp;&amp; cost &lt;= 5000) - amt = cost * 0.9; - else if (cost &gt; 5000 &amp;&amp; cost &lt;= 10000) - amt = cost * 0.85; - else if (cost &gt; 10000) - amt = cost * 0.8; - printf(&quot;\nAmount to be paid : %g&quot;, amt); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P024-c', 'P024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P024.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P024.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P024-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to check whether a year is leapyear or not. */ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -int main() -{ - int year; - printf(&quot;Enter the year : &quot;); - scanf(&quot;%d&quot;, &amp;year); - if (year % 4 == 0 &amp;&amp; year % 100 != 0) - printf(&quot;\nYear %d is a leapyear.&quot;, year); - else if (year % 400 == 0) - printf(&quot;\nYear %d is a leapyear (Century).&quot;, year); - else - printf(&quot;\nYear %d is not a leapyear.&quot;, year); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P025-c', 'P025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P025.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P025.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P025-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input the electricity unit consumed and calculate the total -bill amount according to the given condition : - for 1st 50 unit Rs. 0.50 per unit - next 100 unit Rs. 0.75 per unit - next 100 unit Rs. 1.20 per unit - above 250 unit Rs. 1.50 per unit -And additional charge of 20 percent is added to the bill. -*/ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -int main() -{ - double unit, amt; - printf(&quot;Enter the electricity consp(unit) : &quot;); - scanf(&quot;%lf&quot;, &amp;amt); - if (unit &lt;= 50) - amt = unit * 0.50; - else if (unit &gt; 50 &amp;&amp; unit &lt;= 50) - amt = 25 + ((unit - 50) * 0.75); - else if (unit &gt; 150 &amp;&amp; unit &lt;= 250) - amt = 25 + 75 + ((unit - 150) * 1.20); - else if (unit &gt; 250) - amt = 25 + 75 + 120 + ((unit - 250) * 1.50); - amt = amt * 1.20; - printf(&quot;\nAmount to be paid : %g&quot;, amt); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P026-c', 'P026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P026.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P026.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P026-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to input sum (p), rate of interest (r), time (t) and type of interest -(&#x27;s&#x27; for simple interest amd &#x27;c&#x27; for compound interest). Calculate and display -the interest earned - si = (p * r * t) / 100 - compoundInterest = p * ((1 + r / 100)^t - 1) -*/ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;ctype.h&gt; -int main() -{ - double principalAmount, rateOfInterest, timePeriod, simpleInterest, compoundInterest; - char mode; - printf(&quot;Enter the principle amount, Rate of interest, Time : &quot;); - scanf(&quot;%lf %lf %lf&quot;, &amp;principalAmount, &amp;rateOfInterest, &amp;timePeriod); - printf(&quot;\nEnter the mode (&#x27;s&#x27; : simple interest, &#x27;c&#x27; : compound interest) : &quot;); - scanf(&quot; %c&quot;, &amp;mode); - mode = tolower(mode); - switch (mode) - { - case &#x27;s&#x27;: - simpleInterest = (principalAmount * rateOfInterest * timePeriod) / 100; - printf(&quot;\nSimple Interest : %g&quot;, simpleInterest); - break; - case &#x27;c&#x27;: - compoundInterest = principalAmount * (pow((1 + rateOfInterest / 100), timePeriod) - 1); - printf(&quot;\nCompound Interest : %g&quot;, compoundInterest); - break; - default: - printf(&quot;\nInvalid Input&quot;); - return 1; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P027-c', 'P027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P027.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P027.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P027-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Purchase Discount on Discount on - Amount Laptop Desktop - -------- ----------- ----------- - Upto 20k 3.0% 5.0% - 20001 - 50k 5.0% 7.5% - 50001 - 75k 7.5% 10.5% - more than 75k 10.0% 15.0% -WAP to input amount of purchase and type of purchase (&#x27;L&#x27; : laptop, &#x27;D&#x27; : desktop) -and display the discount amount and the discounted price (Net Amount). -*/ -/* Author - Amit Dutta, Date - 8th OCT, 2025 */ -// This code has not been compiled. -// If you find any issues, please create a new issue on GitHub regarding them. - -#include &lt;stdio.h&gt; -#include &lt;ctype.h&gt; -int main() -{ - double principal_amount, desktop_discount, laptop_discount, discount_amount, discounted_price; - char choice; - printf(&quot;Enter the purchase amount : &quot;); - scanf(&quot;%lf&quot;, &amp;principal_amount); - printf(&quot;Type of purchase (&#x27;L&#x27; : Laptop, &#x27;D&#x27; : Desktop) : &quot;); - scanf(&quot; %c&quot;, &amp;choice); - choice = toupper(choice); - if (principal_amount &lt;= 20000) - { - laptop_discount = 0.03; - desktop_discount = 0.05; - } - else if (principal_amount &gt; 20000 &amp;&amp; principal_amount &lt;= 50000) - { - laptop_discount = 0.05; - desktop_discount = 0.075; - } - else if (principal_amount &gt; 50000 &amp;&amp; principal_amount &lt;= 75000) - { - laptop_discount = 0.075; - desktop_discount = 0.105; - } - else if (principal_amount &gt; 75000) - { - laptop_discount = 0.1; - desktop_discount = 0.15; - } - switch (choice) - { - case &#x27;L&#x27;: - discount_amount = principal_amount * laptop_discount; - discounted_price = principal_amount - discount_amount; - printf(&quot;\nDiscount Amount : %g&quot; - &quot;\nDiscounted Price : %g&quot;, - discount_amount, discounted_price); - break; - case &#x27;D&#x27;: - discount_amount = principal_amount * desktop_discount; - discounted_price = principal_amount - discount_amount; - printf(&quot;\nDiscount Amount : %g&quot; - &quot;\nDiscounted Price : %g&quot;, - discount_amount, discounted_price); - break; - default: - printf(&quot;\nInvalid Input.&quot;); - return 1; - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P028-c', 'P028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P028.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P028.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P028-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to calculate factorial of a number */ -/* Author - Amit Dutta, Date - 11th OCT, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int i = 1, num, fact = 1; - printf(&quot;Enter the number : &quot;); - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - return 1; - } - if (num == 0) - { - printf(&quot;\nFactorial of 0 : 1&quot;); - return 0; - } - if (num &lt; 0) - { - printf(&quot;\nFactorial of %d : UNDEFINED&quot;, num); - return 0; - } - while (i &lt;= num) - { - fact = fact * i; - i++; - } - printf(&quot;Factorial of %d : %d&quot;, num, fact); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P029-c', 'P029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P029.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P029.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P029-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ... */ -/* Author - Amit Dutta, Date - 11th OCT, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int num, i = 0, result = 0; - printf(&quot;Enter the value for n : &quot;); - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nPlease enter a number.&quot;); - return 1; - } - if (num &lt; 1) - { - printf(&quot;\nPlease enter a positive number.&quot;); - return 1; - } - while (i &lt;= num) - { - result = result + i; - i++; - } - printf(&quot;\nResult : %d&quot;, result); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P030-c', 'P030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P030.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P030.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P030-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Display the first 15 terms of the series. */ -/* Author - Amit Dutta, Date - 11th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int main() -{ - int i, r; - - // 3, 6, 9, 12, ... - { - i = 3, r = 0; - printf(&quot;Series 1 (3, 6, 9, 12, ...) :&quot;); - while (i &lt;= 15) - { - r = r + 3; - printf(&quot; %d&quot;, r); - i++; - } - } - - // 1, 4, 9, 16, ... - { - i = 1; - printf(&quot;\nSeries 2 (1, 4, 9, 16, ...) :&quot;); - while (i &lt;= 15) - { - printf(&quot; %d&quot;, i * i); - i++; - } - } - - // 4, 8, 16, 32, ... - { - i = 1, r = 2; - printf(&quot;\nSeries 3 (4, 8, 16, 32, ...) :&quot;); - while (i &lt;= 15) - { - r = r * 2; - printf(&quot; %d&quot;, r); - i++; - } - } - - // 0, 7, 26, ... - { - i = 1, r; - printf(&quot;\nSeries 4 (0, 7, 26, ...) :&quot;); - while (i &lt;= 15) - { - r = (int)pow(i, 3) - 1; - printf(&quot; %d&quot;, r); - i++; - } - } - - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P031-c', 'P031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P031.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P031.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P031-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Find the sum of the series */ -/* Author - Amit Dutta, Date - 11th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -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(&quot;--- s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10) ---&quot;); - printf(&quot;\nEnter the number : &quot;); - scanf(&quot;%lf&quot;, &amp;a); - while (i &lt;= 10) - { - res = res + ((a * a) / i); - i++; - } - printf(&quot;S = %g&quot;, res); - } - - // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n - { - res = 0, i = 0; - printf(&quot;\n--- // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n ---&quot;); - printf(&quot;\nEnter the value for a and n : &quot;); - scanf(&quot; %lf %lf&quot;, &amp;a, &amp;n); - while (i &lt;= n - 1) - { - res = res + (pow(i + 1, i + 1) / pow(a, i)); - i++; - } - printf(&quot;S = %g&quot;, res); - } - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P032-c', 'P032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P032.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P032.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P032-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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 &lt;stdio.h&gt; -int main() -{ - int n, temp, sod = 0; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - temp = n; - while (temp &gt; 0) - { - sod = sod + (temp % 10); - temp = temp / 10; - } - if (n % sod == 0) - printf(&quot;\nIt is Niven number.&quot;); - else - printf(&quot;\nIt is not a Niven number.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P033-c', 'P033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P033.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P033.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P033-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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 &lt;stdio.h&gt; -int main() -{ - int inp, odd = 0, even = 0, temp; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;inp); - temp = inp; - while (temp &gt; 0) - { - if ((temp % 10) % 2 == 0) - even += temp % 10; - else - odd += temp % 10; - temp /= 10; - } - printf(&quot;\nSum of even : %d&quot; - &quot;\nSum of odd : %d&quot;, - even, odd); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P034-c', 'P034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P034.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P034.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P034-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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 &lt;stdio.h&gt; -int main() -{ - int inp, temp, index = 1, even = 0, odd = 0; - printf(&quot;Enter the numebr : &quot;); - scanf(&quot;%d&quot;, &amp;inp); - temp = inp; - while (temp &gt; 0) - { - if (index % 2 == 0) - even += temp % 10; - else - odd += temp % 10; - temp /= 10; - index++; - } - printf(&quot;\nSum of even position digits : %d&quot; - &quot;\nSum of odd position digits : %d&quot;, - even, odd); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P035-c', 'P035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P035.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P035.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P035-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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 &lt;stdio.h&gt; -#include &lt;stdbool.h&gt; -int main() -{ - int n, res = 1, temp; - bool status = false; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - temp = n; - while (temp &gt; 0) - { - if ((temp % 10) % 2 == 0) - { - res *= (temp % 10) + 1; - status = true; - } - temp /= 10; - } - if (!status) - printf(&quot;\nThere is no even digits.&quot;); - else - printf(&quot;\nThe product of the successors of even digits of the number %d is : %d&quot;, n, res); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P036-c', 'P036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P036.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P036.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P036-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */ -/* Author - Amit Dutta, Date - 18th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int main() -{ - double a, sum = 0; - int n, i; - printf(&quot;Enter value for a and n : &quot;); - scanf(&quot;%lf %d&quot;, &amp;a, &amp;n); - for (i = 1; i &lt;= n; i++) - sum += pow(a, i) / i; - printf(&quot;\nSum = %g&quot;, sum); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P037-c', 'P037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P037.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P037.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P037-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* 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 &lt;stdio.h&gt; - -int main() -{ - double sum = 0, temp1 = 0, temp2 = 1; - int n, i; - printf(&quot;Enter value for n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - temp1 += i; - temp2 *= i; - sum += temp1 / temp2; - } - printf(&quot;\nSum = %g&quot;, sum); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P038-c', 'P038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P038.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P038.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P038-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check prime number */ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;stdbool.h&gt; - -int main() -{ - int num, i, endCheckDigit; - bool isPrime = true; - printf(&quot;Enter the number : &quot;); - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nOnly a number is allowed, not a character.&quot;); - return 1; - } - if (num &lt;= 0) - { - printf(&quot;\nOnly postive number is allowed.&quot;); - return 1; - } - if (num == 1) - { - printf(&quot;\nInput 1 is not a prime number.&quot; - &quot;\nHas only one positive divisor (itself), not exactly two.&quot; - &quot;\nRule: Prime number should have exactly two distinct positive divisors: 1 and itself&quot;); - return 0; - } - if (num == 2) - { - printf(&quot;\nInput 2 is a prime number.&quot; - &quot;\n(Note: 2 is only Even Prime Number)&quot;); - return 0; - } - if (num % 2 == 0) - { - printf(&quot;\nInput %d is not a prime number.&quot;, num); - return 0; - } - endCheckDigit = sqrt(num); - for (i = 3; i &lt;= endCheckDigit; i += 2) - { - if (num % i == 0) - { - isPrime = false; - printf(&quot;\nInput %d is not prime number.&quot;, num); - return 0; - } - } - if (isPrime) - { - printf(&quot;\nInput %d is a prime number.&quot;, num); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P039-c', 'P039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P039.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P039.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P039-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to print all the factors of a postive integer */ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int num, i; - printf(&quot;Enter a number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - printf(&quot;\nFactors of %d : &quot;, num); - for (i = 1; i &lt;= num / 2; i++) - { - if (num % i == 0) - { - printf(&quot; %d&quot;, i); - } - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P040-c', 'P040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P040.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P040.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P040-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to calculate HCF of two positive number */ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int a, b, temp; - printf(&quot;Enter two number : &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - while (b &gt; 0) - { - temp = a; - a = b; - b = temp % b; - } - printf(&quot;HCF = %d&quot;, a); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P041-c', 'P041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P041.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P041.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P041-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to enter two numbers and check they are co-prime or not. - co-prime when HCF = 1 -*/ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int a, b, temp, temp_a, temp_b; - printf(&quot;Enter two number : &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, %d) is co-prime.&quot;, temp_a, temp_b); - } - else - { - printf(&quot;\n(%d, %d) is not co-prime.&quot;, temp_a, temp_b); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P042-c', 'P042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P042.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P042.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P042-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to accept a number and check whether the number -is twisted prime or not. */ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int main() -{ - int n, t, i, r, rev, prime = 1; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 2; i &lt;= (int)sqrt(n); i++) - { - if (n % i == 0) - { - prime = 0; - break; - } - } - if (prime) - { - printf(&quot;%d is a prime number.&quot;, n); - t = n; - rev = 0; - prime = 1; - while (t &gt; 0) - { - r = t % 10; - rev = rev * 10 + r; - t = t / 10; - } - for (i = 2; i &lt;= (int)sqrt(rev); i++) - { - if (rev % i == 0) - { - prime = 0; - break; - } - } - if (prime) - { - printf(&quot;\n%d and %d are prime numbers.. TWISTED PRIME&quot;, n, rev); - } - else - { - printf(&quot;\n%d is non prime&quot;, rev); - } - } - else - { - printf(&quot;\n%d is non prime.&quot;, n); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P043-c', 'P043.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P043.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P043.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P043.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P043-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to check palindrome number. */ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -#include &lt;stdio.h&gt; -int main() -{ - int num, temp, rev; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - temp = num; - rev = 0; - while (temp &gt; 0) - { - rev = (rev * 10) + (temp % 10); - temp /= 10; - } - if (num == rev) - { - printf(&quot;%d is a palindrome number.&quot;, num); - } - else - { - printf(&quot;%d is not a palindrome number.&quot;, num); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P044-c', 'P044.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P044.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P044.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P044.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P044-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to input a number and check whether the -number is Pronic number or not. - Pronic Number: The number which is the product of two numbers - which is the product of two consecutive integer. - Ex: 20 = 4 * 5 -*/ -/* Author - Amit Dutta, Date - 27th OCT, 2025 */ - -// using boolean... -/* -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; -#include &lt;stdbool.h&gt; - -int main() -{ - int num, iterationIndex; - bool isPronic = false; - printf(&quot;Enter the number : &quot;); - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nYou have to enter a number, not an character or symbol.&quot;); - return 1; - } - if (num &lt; 1) - { - printf(&quot;\nOnly postive number is allowed.&quot;); - return 1; - } - for (iterationIndex = 1; iterationIndex &lt;= num / 2; iterationIndex++) - { - if (iterationIndex * (iterationIndex + 1) == num) - { - printf(&quot;\nInput %d is a Pronic Number.&quot;, num); - isPronic = true; - break; - } - } - if(!isPronic) - { - printf(&quot;\nInput %d is not a Pronic Number.&quot;, num); - } - return 0; -} -*/ - -// using direct return method (more efficient and generally preferred)... - -#include &lt;stdio.h&gt; -#include &lt;math.h&gt; - -int main() -{ - int num, iterationIndex, iterationLimit; - printf(&quot;Enter the number : &quot;); - if (scanf(&quot;%d&quot;, &amp;num) != 1) - { - printf(&quot;\nYou have to enter a number, not an character or symbol.&quot;); - return 1; - } - if (num &lt; 1) - { - printf(&quot;\nOnly postive number is allowed.&quot;); - return 1; - } - iterationLimit = (int)sqrt(num); - for (iterationIndex = 1; iterationIndex &lt;= iterationLimit; iterationIndex++) - { - if (iterationIndex * (iterationIndex + 1) == num) - { - printf(&quot;\nInput %d is a Pronic Number.&quot;, num); - return 0; - } - } - printf(&quot;\nInput %d is not a Pronic Number.&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P045-c', 'P045.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P045.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P045.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P045.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P045-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Make this pattern for input n. - Pattern : - 1 - 1 2 - 1 2 3 - 1 2 3 4 - 1 2 3 4 5 -*/ -/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, n; - printf(&quot;Enter n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - for (j = 1; j &lt;= i; j++) - { - printf(&quot;%d\t&quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P046-c', 'P046.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P046.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P046.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P046.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P046-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Make this pattern for input n. - Pattern : - 1 - 2 1 - 3 2 1 - 4 3 2 1 - 5 4 3 2 1 -*/ -/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, n; - printf(&quot;Enter n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - for (j = i; j &gt;= 1; j--) - { - printf(&quot;%d\t&quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P047-c', 'P047.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P047.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P047.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P047.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P047-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Make this pattern for input n. - Pattern : - 5 - 5 4 - 5 4 3 - 5 4 3 2 - 5 4 3 2 1 -*/ -/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, n; - printf(&quot;Enter n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = n; i &gt;= 1; i--) - { - for (j = n; j &gt;= i; j--) - { - printf(&quot;%d\t&quot;, j); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P048-c', 'P048.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P048.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P048.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P048.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P048-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Make this pattern for input n no of row. - Pattern : - 1 - 2 3 - 4 5 6 - 7 8 9 10 - 11 12 13 14 15 -*/ -/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, n, temp = 1; - printf(&quot;Enter row number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - for (j = 1; j &lt;= i; j++) - { - printf(&quot;%d\t&quot;, temp); - temp++; - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P049-c', 'P049.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P049.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P049.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P049.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P049-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Make this pattern for input n no of row. - Pattern : - # - @ @ - # # # - @ @ @ @ - # # # # # - */ -/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ - -#include &lt;stdio.h&gt; - -int main() -{ - int i, j, n; - char a = &#x27;#&#x27;, b = &#x27;@&#x27;; - printf(&quot;Enter row number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - for (j = 1; j &lt;= i; j++) - { - if (i % 2 == 0) - printf(&quot;%c\t&quot;, b); - else - printf(&quot;%c\t&quot;, a); - } - printf(&quot;\n&quot;); - } - return 0; -} -</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P050-SHORT-c', 'P050-SHORT.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050-SHORT.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P050-SHORT.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050-SHORT.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P050-SHORT-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to input a number and check whether it is Disarium Number or not. - Note : A number is said to Disarium if sum of its digit powered by with their - respective position is equal to the original number. */ -/* Author - Amit Dutta, Date - 08th November, 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; -#include &lt;math.h&gt; - -int main() -{ - int num; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - int position = printf(&quot;%d&quot;, num); - int temp = num; - int res = 0; - while (temp &gt; 0) - { - res += (int)pow(temp % 10, position); - position--; - temp /= 10; - } - if (res == num) - printf(&quot; is a Disarium Number.&quot;); - else - printf(&quot; is Not a Disarium Number.&quot;); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P050-c', 'P050.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P050.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P050-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to input a number and check whether it is Disarium Number or not. - Note : A number is said to Disarium if sum of its digit powered by with their - respective position is equal to the original number. */ -/* Author - Amit Dutta, Date - 08th November, 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; -#include &lt;math.h&gt; - -int main() -{ - int num, res = 0, temp, position = 0; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;num); - temp = num; - while (temp &gt; 0) - { - position++; - temp /= 10; - } - temp = num; - while (temp &gt; 0) - { - res += (int)pow(temp % 10, position); - position--; - temp /= 10; - } - if (res == num) - printf(&quot;\nInput %d is a Disarium Number.&quot;, num); - else - printf(&quot;\nInput %d is Not a Disarium Number.&quot;, num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P051-c', 'P051.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P051.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P051.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P051.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P051-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to input two number and check whether they are Amicable Pair or not - Example : Sum of Proper Divisors of 220 (1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110) = 284 - Sum of Proper Divisors of 284 (1, 2, 4, 71, 142) = 220 */ -/* Author - Amit Dutta, Date - 09th November, 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() -{ - int a, b, i, sa = 0, sb = 0; - printf(&quot;Enter two number : &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - for (i = 1; i &lt;= a / 2; i++) - if (a % i == 0) - sa += i; - for (i = 1; i &lt;= b / 2; i++) - if (b % i == 0) - sb += i; - if (sa == b &amp;&amp; sb == a) - printf(&quot;\nInput %d and %d is Amicable Pair.&quot;, a, b); - else - printf(&quot;\nInput %d and %d is Not Amicable Pair.&quot;, a, b); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P052-c', 'P052.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P052.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P052.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P052.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P052-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Print the sum of this series for upto n element. - Series: 1 + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + ... + (1 + 2 + 3 + ... + n) */ -/* Author - Amit Dutta, Date - 09th November, 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() -{ - int n, sum = 0, temp = 0, i; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - for (i = 1; i &lt;= n; i++) - { - temp += i; - sum += temp; - } - printf(&quot;%d&quot;, sum); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P053-c', 'P053.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P053.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P053.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P053.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P053-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Print all pattern */ -/* Author - Amit Dutta, Date - 09th November, 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() -{ - int i, j, temp; - - printf(&quot;\n\nPattern 1 : \n\n&quot;); - /* - 9 9 9 9 9 - 7 7 7 7 7 - 5 5 5 5 5 - 3 3 3 3 3 - 1 1 1 1 1 - */ - temp = 9; - for (i = 1; i &lt;= 5; i++) - { - for (j = 1; j &lt;= 5; j++) - { - printf(&quot;%d &quot;, temp); - } - printf(&quot;\n&quot;); - temp -= 2; - } - - // Another method print above pattern - printf(&quot;\n\nPattern 1 : \n\n&quot;); - for (i = 9; i &gt;= 1; i -= 2) - { - for (j = 1; j &lt;= 5; j++) - { - printf(&quot;%d &quot;, i); - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 2 : \n\n&quot;); - /* - 1 2 3 4 5 - 1 2 3 4 5 - 1 2 3 4 5 - */ - for (i = 1; i &lt;= 3; i++) - { - for (j = 1; j &lt;= 5; j++) - { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 3 : \n\n&quot;); - /* - 5 4 3 2 1 - 5 4 3 2 1 - */ - for (i = 1; i &lt;= 2; i++) - { - for (j = 5; j &gt;= 1; j--) - { - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 4 : \n\n&quot;); - /* - 1 2 3 4 - 5 6 7 8 - 9 10 11 12 - */ - temp = 1; - for (i = 1; i &lt;= 3; i++) - { - for (j = 1; j &lt;= 4; j++) - { - printf(&quot;%d &quot;, temp); - temp++; - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 5 : \n\n&quot;); - /* - 1 2 3 4 - 4 8 12 16 - 1 2 3 4 - 4 8 12 16 - 1 2 3 4 - */ - for (i = 1; i &lt;= 5; i++) - { - for (j = 1; j &lt;= 4; j++) - { - if (i % 2 == 0) - printf(&quot;%d &quot;, j * 4); - else - printf(&quot;%d &quot;, j); - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 6 : \n\n&quot;); - /* - 1 - 2 4 - 3 5 7 - 6 8 10 12 - 9 11 13 15 17 - */ - int odd = 1, even = 2; - for (i = 1; i &lt;= 5; i++) - { - for (j = 1; j &lt;= i; j++) - { - if (i % 2 == 0) - { - printf(&quot;%d &quot;, even); - even += 2; - } - else - { - printf(&quot;%d &quot;, odd); - odd += 2; - } - } - printf(&quot;\n&quot;); - } - - printf(&quot;\n\nPattern 7 : \n\n&quot;); - /* - 1 2 3 4 5 - 6 7 8 9 - 10 11 12 - 13 14 - 15 - */ - temp = 1; - for (i = 5; i &gt;= 1; i--) - { - for (j = 1; j &lt;= i; j++) - { - printf(&quot;%d &quot;, temp); - temp++; - } - printf(&quot;\n&quot;); - } - - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P054-c', 'P054.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P054.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P054.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P054.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P054-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to check Krishnamurty number using user defined methods/functions. */ -/* Author - Amit Dutta, Date - 15th November, 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 fact(int); -int isKrishnamurty(int); - -int fact(int n) -{ - int fact = 1, i; - for (i = 1; i &lt;= n; i++) - fact *= i; - return fact; -} - -int isKrishnamurty(int n) -{ - int temp = n, sum = 0; - while (temp &gt; 0) - { - sum += fact(temp % 10); - temp /= 10; - } - return n == sum; -} - -int main() -{ - int n; - printf(&quot;Enter the number : &quot;); - scanf(&quot;%d&quot;, &amp;n); - if (isKrishnamurty(n)) - printf(&quot;\nInput %d is a Krishnamurty Number.&quot;, n); - else - printf(&quot;\nInput %d is not a Krishnamurty number.&quot;, n); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P055-c', 'P055.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P055.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P055.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P055.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P055-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to print n terms of Fibbonacci Series (Starting from term 0) */ -/* Author - Amit Dutta, Date - 15th November, 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; - -void printFibonacci(int); - -void printFibonacci(int n) -{ - int val1 = 0, val2 = 1, val3, i; - printf(&quot;\nFibonacci series upto %d terms :&quot;, n); - if (n &lt; 0) - printf(&quot; N/A&quot;); - if (n == 0) - printf(&quot; %d&quot;, val1); - if (n &gt; 0) - printf(&quot; %d %d&quot;, val1, val2); - for (i = 2; i &lt;= n; i++) - { - val3 = val1 + val2; - printf(&quot; %d&quot;, val3); - val1 = val2; - val2 = val3; - } -} - -int main() -{ - int n; - printf(&quot;Enter the n : &quot;); - scanf(&quot;%d&quot;, &amp;n); - printFibonacci(n); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P056-c', 'P056.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P056.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P056.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P056.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P056-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to swap the value of a and b using user defined method. */ -/* Author - Amit Dutta, Date - 22th November, 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; - -void swap(int *a, int *b) -{ - int temp = *a; - *a = *b; - *b = temp; -} - -int main() -{ - int a, b; - printf(&quot;Enter A and B: &quot;); - scanf(&quot;%d %d&quot;, &amp;a, &amp;b); - printf(&quot;\nBefore swap A: %d, B: %d&quot;, a, b); - swap(&amp;a, &amp;b); - printf(&quot;\nAfter swap A: %d, B: %d&quot;, a, b); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P057-c', 'P057.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P057.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P057.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P057.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P057-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to display the series using user defined method. - 0, 7, 26, 63, ... upto n terms using void series(int n) -*/ -/* Author - Amit Dutta, Date - 22th November, 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; - -void series(int n) -{ - int i; - printf(&quot;\nSeries: &quot;); - for (i = 1; i &lt;= n; i++) - printf(&quot;%d &quot;, (i * i * i) - 1); -} - -int main() -{ - int n; - printf(&quot;Enter n: &quot;); - scanf(&quot;%d&quot;, &amp;n); - series(n); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P058-c', 'P058.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P058.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P058.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P058.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P058-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to display ASCII code of Alphabets (A - Z) using void displayASCII() */ -/* Author - Amit Dutta, Date - 22th November, 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; - -void displayASCII() -{ - int i; - printf(&quot;ASCII Code\t\tCharacter&quot;); - for (i = &#x27;A&#x27;; i &lt;= &#x27;Z&#x27;; i++) - printf(&quot;\n%c\t\t%d&quot;, i, i); -} - -int main() -{ - displayASCII(); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P059-c', 'P059.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P059.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P059.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P059.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P059-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to find the sum of array elements using following fuctions - int array_sum(int a[], int n); - void get_data(int a[], int n); - voidd dispaly(int a[], int n); -*/ -/* Author - Amit Dutta, Date - 29th November, 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 array_sum(int[], int); -void get_data(int[], int); -void display(int[], int); - -int main() -{ - int size, arr[20]; - printf(&quot;How many element do you want to add (Max: 20): &quot;); - scanf(&quot;%d&quot;, &amp;size); - if (size &lt; 1 &amp;&amp; size &gt; 20) - { - printf(&quot;\nMax Element count is 20.&quot;); - return 1; - } - get_data(arr, size); - display(arr, size); - printf(&quot;\nSum of the elements is: %d&quot;, array_sum(arr, size)); - return 0; -} - -void get_data(int a[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element for position %d: &quot;, i); - scanf(&quot;%d&quot;, &amp;a[i]); - } -} - -void display(int a[], int n) -{ - int i; - printf(&quot;\nArray: [&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot;%d&quot;, a[i]); - if (i != n - 1) - printf(&quot;, &quot;); - } - printf(&quot;]\n&quot;); -} - -int array_sum(int a[], int n) -{ - int i, sum = 0; - for (i = 0; i &lt; n; i++) - sum += a[i]; - return sum; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P060-c', 'P060.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P060.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P060.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P060.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P060-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* write a C program to count the occurrences of a given element in an array using a user-defined -function. Create a function int count_occurrences(int arr[], int n, int target) that countts how -many times target appears in the array. */ - -#include &lt;stdio.h&gt; - -int count_occurrences(int[], int, int); -void inputarr(int[], int); - -int main() -{ - int n, arr[20], target, found; - printf(&quot;Enter the n (Max: 20): &quot;); - scanf(&quot;%d&quot;, &amp;n); - inputarr(arr, n); - printf(&quot;Enter the target: &quot;); - scanf(&quot;%d&quot;, &amp;target); - found = count_occurrences(arr, n, target); - if (found) - { - printf(&quot;\n%d found %d times.&quot;, target, found); - } - else - { - printf(&quot;\n%d is not found.&quot;, target); - } - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int count_occurrences(int arr[], int n, int target) -{ - int count = 0; - int i; - for (i = 0; i &lt; n; i++) - { - if (arr[i] == target) - { - count++; - } - } - return count; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P061-c', 'P061.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P061.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P061.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P061.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P061-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program to find the sum of even elements in an array using a user defined function. -Define a functions int sumEven(int arr[], int n) that returns the sum of all even elements in the array. */ - -#include &lt;stdio.h&gt; - -void inputarr(int[], int); -int sumEven(int[], int); - -int main() -{ - int arr[20], n; - printf(&quot;Enter the n (Max: 20): &quot;); - scanf(&quot;%d&quot;, &amp;n); - inputarr(arr, n); - printf(&quot;\nSum of the even number in the array: %d&quot;, sumEven(arr, n)); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int sumEven(int arr[], int n) -{ - int i, sum_even = 0; - for (i = 0; i &lt; n; i++) - { - if (arr[i] % 2 == 0) - { - sum_even += arr[i]; - } - } - return sum_even; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P062-c', 'P062.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P062.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P062.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P062.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P062-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program to find the smallest and largest in an array using user-defined functions. -Define two functions int findSmallest(int arr[], int n) and int findLargest(int arr[], int n) that -return the smallest and largest elements in an array, respectively. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputarr(int[], int); -int findSmallest(int[], int); -int findLargest(int[], int); - -int main() -{ - int n, *arr; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;n); - arr = (int *)malloc(n * sizeof(int)); - inputarr(arr, n); - printf(&quot;\nSmallest element = %d&quot;, findSmallest(arr, n)); - printf(&quot;\nLargest element = %d&quot;, findLargest(arr, n)); - free(arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter Element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int findSmallest(int arr[], int n) -{ - int i, smallest = arr[0]; - for (i = 1; i &lt; n; i++) - { - if (smallest &gt; arr[i]) - { - smallest = arr[i]; - } - } - return smallest; -} - -int findLargest(int arr[], int n) -{ - int i, largest = arr[0]; - for (i = 1; i &lt; n; i++) - { - if (largest &lt; arr[i]) - { - largest = arr[i]; - } - } - return largest; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P063-c', 'P063.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P063.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P063.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P063.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P063-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program to find all Niven in an array. Define a user-defined function int isNiven(int num) -that returns 1 if the numbers is a Niven number, otherwise returns 0. A Niven number (also known as a -Harshad Number) is an integer that is divisible by the sum of its digits. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void inputarr(int[], int); -int isNiven(int); - -int main() -{ - int n, *arr, i; - printf(&quot;How many element do you want to enter: &quot;); - scanf(&quot;%d&quot;, &amp;n); - arr = (int *)malloc(n * sizeof(int)); - inputarr(arr, n); - for (i = 0; i &lt; n; i++) - { - if (isNiven(arr[i])) - { - printf(&quot;\n%d is a Niven number.&quot;, arr[i]); - } - else - { - printf(&quot;\n%d is a NOT Niven number.&quot;, arr[i]); - } - } - free(arr); - return 0; -} - -void inputarr(int arr[], int n) -{ - int i; - for (i = 0; i &lt; n; i++) - { - printf(&quot;Enter Element %d: &quot;, i + 1); - scanf(&quot;%d&quot;, &amp;arr[i]); - } -} - -int isNiven(int num) -{ - int i, sum = 0, temp = num; - while (temp &gt; 0) - { - sum += temp % 10; - temp /= 10; - } - return num % sum == 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P064-c', 'P064.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P064.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P064.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P064.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P064-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev/ ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to merge two sorted integer arrays to form a single sorted array. */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -void merge(int[], int, int[], int); - -int main() -{ - int a[] = {10, 30, 50, 70, 90}; - int b[] = {20, 40, 60, 80, 100}; - int n1 = sizeof(a) / sizeof(a[0]); - int n2 = sizeof(b) / sizeof(b[0]); - merge(a, n1, b, n2); - return 0; -} - -void merge(int a[], int n1, int b[], int n2) -{ - int n = n1 + n2; - int *c = (int *)malloc(n * sizeof(int)); - int i, j, k; - i = j = k = 0; - while (i &lt; n1 &amp;&amp; j &lt; n2) - { - if (a[i] &lt; b[j]) - { - c[k++] = a[i++]; - } - else - { - c[k++] = b[j++]; - } - } - while (i &lt; n1) - { - c[k++] = a[i++]; - } - while (j &lt; n2) - { - c[k++] = b[j++]; - } - printf(&quot;Merged Array:&quot;); - for (i = 0; i &lt; n; i++) - { - printf(&quot; %d&quot;, c[i]); - } - free(c); -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P065-c', 'P065.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P065.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P065.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P065.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P065-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to reverse a string */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; -#include &lt;string.h&gt; - -void str_rev(char[]); - -int main() -{ - char str[101]; - printf(&quot;Enter the string (Max: 100 Character): &quot;); - gets(str); - printf(&quot;\nBefore Reverse: %s&quot;, str); - str_rev(str); - printf(&quot;\nAfter Reverse: %s&quot;, str); - return 0; -} - -void str_rev(char str[]) -{ - int i, j; - char temp; - i = 0; - j = strlen(str) - 1; // not taking the null - while (i &lt; j) - { - temp = str[i]; - str[i] = str[j]; - str[j] = temp; - i++; - j--; - } -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P066-c', 'P066.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P066.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P066.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P066.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P066-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* WAP to find the length of a string using - i) Library Method - ii) User defined method -*/ - -#include &lt;stdio.h&gt; -#include &lt;string.h&gt; - -int sLength(char str[]) -{ - int i = 0; - while (str[i] != &#x27;\0&#x27;) - { - i++; - } - return i; -} - -int main() -{ - char str[30]; - int len; - printf(&quot;Enter the string: &quot;); - gets(str); - len = strlen(str); - printf(&quot;Length of the string: %d&quot;, len); - printf(&quot;\nLength of the string (U-D): %d&quot;, len); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P067-c', 'P067.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P067.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P067.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P067.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P067-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using function which concatenates two string s1 and s2 in to a third string */ - -#include &lt;stdio.h&gt; - -void string_concat(char *s3, char s1[], char s2[]) -{ - int l1, l2, i, j, k; - i = j = k = 0; - l1 = strlen(s1); - l2 = strlen(s2); - s3 = (char *)malloc((l1 + l2 + 1) * sizeof(char)); - while (s1[i] != &#x27;\0&#x27;) - { - s3[k++] = s1[i++]; - } - while (s2[j] != &#x27;\0&#x27;) - { - s3[k++] = s2[j++]; - } - s3[k] = &#x27;\0&#x27;; - puts(s3); -} - -int main() -{ - char s1[] = &quot;JAVA&quot;; - char s2[] = &quot;PYTHON&quot;; - char *s3 = NULL; - string_concat(s3, s1, s2); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P068-c', 'P068.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P068.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P068.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P068.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P068-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a c program that perform the operation of strcmp() */ - -#include &lt;stdio.h&gt; -#include &lt;stdlib.h&gt; - -int string_compare1(char s1[], char s2[]) -{ - int i, c, cmp = 0, p = 0; - i = 0; - while (s1[i] != &#x27;\0&#x27; &amp;&amp; s2[i] != &#x27;\0&#x27;) - { - if (s1[i] != s2[i]) - { - cmp = s1[i] - s2[i]; - p = 1; - break; - } - i++; - } - c = s1[i] != &#x27;\0&#x27; ? s1[i] : (-1) * s2[i]; - return p == 1 ? cmp : c; -} -int string_compare2(char *s1, char *s2) -{ - while (*s1 != &#x27;\0&#x27; &amp;&amp; (*s1 == *s2)) - { - s1++; - s2++; - } - return *s1 - *s2; -} - -int main() -{ - char str1[] = &quot;AMIT&quot;; - char str2[] = &quot;Amit&quot;; - printf(&quot;Result 1 = %d&quot;, string_compare1(str1, str2)); - printf(&quot;\nResult 2 = %d&quot;, string_compare2(str1, str2)); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P069-c', 'P069.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P069.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P069.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P069.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P069-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program using user defined method to implement the following - JAVA PROG Mastery -&gt; JPM - java prog mastery -&gt; JPM - Acharya Prafulla Chandra -&gt; JPM -*/ - -#include &lt;stdio.h&gt; -#include &lt;ctype.h&gt; - -void _short_1(char str[]) -{ - int i = 0, j = 0; - char s[10]; - if (str[0] != &#x27;\0&#x27; &amp;&amp; str[0] != &#x27; &#x27;) - { - s[j] = toupper(str[j]); - i++; - j++; - } - while (str[i] != &#x27;\0&#x27;) - { - if (str[i] == &#x27; &#x27;) - { - s[j] = toupper(str[i + 1]); - i++; - j++; - } - i++; - } - s[j] = &#x27;\0&#x27;; - printf(&quot;\nResult 1: %s&quot;, s); -} - -void _short_2(char str[]) -{ - int i, j; - char strnew[10]; - strnew[0] = toupper(str[0]); - i = j = 1; - while (str[i] != &#x27;\0&#x27;) - { - if (str[i] == &#x27; &#x27;) - { - strnew[j++] = toupper(str[i + 1]); - } - i++; - } - strnew[j] = &#x27;\0&#x27;; - printf(&quot;\nResult 2: %s&quot;, strnew); -} - -int main() -{ - char str[30]; - printf(&quot;Enter the string: &quot;); - gets(str); - _short_1(str); - _short_2(str); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P070-c', 'P070.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P070.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P070.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P070.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-tuition-c-P070-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://esal.amit.is-a.dev ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a program to perform addition of two complex number having fields &#x27;real&#x27; and &#x27;img&#x27; -of type integer. */ - -#include &lt;stdio.h&gt; - -struct complex -{ - int real; - int img; -}; - -void getData(struct complex *c) -{ - printf(&quot;Enter real: &quot;); - scanf(&quot;%d&quot;, &amp;c-&gt;real); - printf(&quot;Enter imaginary: &quot;); - scanf(&quot;%d&quot;, &amp;c-&gt;img); -} - -struct complex add(struct complex c1, struct complex c2) -{ - struct complex r; - r.real = c1.real + c2.real; - r.img = c1.img + c2.img; - return r; -} - -void display(struct complex c) -{ - printf(&quot;%d+%di&quot;, c.real, c.img); -} - -int main() -{ - struct complex c1, c2, c3; - getData(&amp;c1); - getData(&amp;c2); - printf(&quot;\nComplex Number 1:\n&quot;); - display(c1); - printf(&quot;\nComplex Number 2:\n&quot;); - display(c2); - c3 = add(c1, c2); - printf(&quot;\nResult: \n&quot;); - display(c3); - return 0; -}</div> - </div> - - </div> - </div> - - </div> - </div> - - </div> - </div> - </div> - - <button id="back-to-top" onclick="scrollToTop()" class="hidden absolute bottom-6 right-6 p-3 bg-neutral-900 border border-neutral-700 text-lime-300 rounded-full shadow-lg hover:bg-lime-300 hover:text-black transition-all z-30"> - <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 10l7-7m0 0l7 7m-7-7v18"></path></svg> - </button> - </main> - </div> - - <!-- Code Viewer Modal --> - <div id="code-modal" class="fixed inset-0 bg-black/80 backdrop-blur-sm hidden flex items-center justify-center z-50 p-2 sm:p-6 opacity-0 transition-opacity duration-200"> - <div class="bg-[#0d1117] w-full max-w-6xl rounded-xl shadow-2xl flex flex-col border border-white/10 transform scale-95 transition-transform duration-200 modal-content-area"> - <!-- Modal Header --> - <div class="flex items-center justify-between px-3 sm:px-4 py-3 border-b border-white/10 bg-[#161b22] rounded-t-xl shrink-0 gap-2"> - <div class="flex items-center gap-3 overflow-hidden"> - <div class="flex gap-1.5 shrink-0 opacity-50"> - <div class="w-3 h-3 rounded-full bg-red-500"></div> - <div class="w-3 h-3 rounded-full bg-yellow-500"></div> - <div class="w-3 h-3 rounded-full bg-green-500"></div> - </div> - <div class="flex flex-col min-w-0"> - <h3 id="modal-filename" class="text-xs sm:text-sm font-mono text-lime-300 truncate font-medium">filename.c</h3> - <span id="modal-filesize" class="text-[10px] text-neutral-500 font-mono"></span> - </div> - </div> - - <div class="flex items-center gap-1 sm:gap-2 shrink-0 relative"> - - <!-- Desktop Buttons Group --> - <div class="hidden sm:flex items-center gap-1 sm:gap-2"> - <button id="new-tab-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Open in New Tab"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /></svg> - </button> - - <!-- Compiler Button --> - <button onclick="openInCompiler()" class="p-2 text-neutral-400 hover:text-lime-300 hover:bg-lime-300/10 rounded-lg transition-all group relative" title="Open in C Compiler"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> - </svg> - </button> - - <button id="download-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Download File"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> - </button> - - <button id="print-btn" onclick="printCode()" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Print Code"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" /></svg> - </button> - - <button id="share-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Copy Link"> - <svg id="share-icon-default" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" /></svg> - <svg id="share-icon-success" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300 hidden transform scale-0 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> - </button> - - <button id="copy-code-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Copy Code"> - <svg id="copy-icon-default" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> - <svg id="copy-icon-success" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300 hidden transform scale-0 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> - </button> - - <a id="modal-raw-link" href="#" target="_blank" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-colors" title="View Raw on GitHub"> - <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - - <!-- Mobile Menu Button --> - <button id="mobile-menu-btn" class="sm:hidden p-2 text-neutral-400 hover:text-white rounded-lg" onclick="toggleMobileMenu(event)"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" /> - </svg> - </button> - - <!-- Mobile Dropdown Menu --> - <div id="mobile-menu-dropdown" class="hidden absolute top-full right-0 mt-2 w-48 bg-[#161b22] border border-white/10 rounded-xl shadow-xl z-50 overflow-hidden font-mono text-sm"> - <button onclick="openInCompiler()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-lime-300 flex items-center gap-3 transition-colors border-b border-white/5"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg> - Compile / Run - </button> - <button onclick="document.getElementById('new-tab-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /></svg> - New Tab - </button> - <button onclick="document.getElementById('download-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> - Download - </button> - <button onclick="printCode()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" /></svg> - Print - </button> - <button onclick="document.getElementById('share-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" /></svg> - Share Link - </button> - <button onclick="document.getElementById('copy-code-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> - Copy Code - </button> - <a id="mobile-github-link" href="#" target="_blank" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors border-t border-white/5"> - <svg class="h-4 w-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - View on GitHub - </a> - </div> - - <!-- Close Button (Always Visible) --> - <button onclick="hideCode()" class="p-2 text-neutral-400 hover:text-white hover:bg-red-900/30 hover:text-red-400 rounded-lg transition-colors ml-1" title="Close"> - <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg> - </button> - </div> - </div> - - <!-- Code Content --> - <div class="flex-1 min-h-0 bg-[#0d1117] relative dark-modal-bg"> - <!-- Loading State --> - <div id="code-loading" class="absolute inset-0 flex items-center justify-center z-10 bg-[#0d1117] hidden"> - <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-lime-300"></div> - </div> - <!-- Code Container --> - <div id="modal-code-container" class="w-full h-full"> - <!-- CodeMirror is injected here --> - </div> - </div> - </div> - </div> - - <!-- License Modal --> - <div id="license-modal" class="fixed inset-0 bg-black/90 backdrop-blur-md hidden flex items-center justify-center z-[60] p-4 sm:p-6 opacity-0 transition-opacity duration-200"> - <div class="bg-[#111] w-full max-w-3xl rounded-xl shadow-2xl flex flex-col border border-neutral-800 transform scale-95 transition-transform duration-200 max-h-[85vh] sm:max-h-[85vh] max-h-[90vh]"> - <!-- Modal Header --> - <div class="flex items-center justify-between px-6 py-4 border-b border-neutral-800 shrink-0"> - <h3 class="text-lg font-bold text-white flex items-center gap-2 font-heading"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /> - </svg> - License Information - </h3> - <div class="flex items-center gap-2"> - <a href="https://esal.amit.is-a.dev" target="_blank" class="p-2 text-neutral-500 hover:text-lime-300 hover:bg-lime-300/10 rounded-lg transition-colors" title="Download License PDF"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> - </a> - <button id="license-close-btn" onclick="hideLicense()" class="p-2 text-neutral-500 hover:text-white hover:bg-neutral-800 rounded-lg transition-colors hidden"> - <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg> - </button> - </div> - </div> - - <!-- License Content --> - <div id="license-content" class="p-6 overflow-y-auto font-mono text-sm leading-relaxed text-neutral-400 bg-[#050505]"> - <div class="border-l-4 border-lime-300 pl-4 mb-6"> - <h4 class="font-bold text-white text-lg">EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)</h4> - <p class="text-lime-300/80 font-medium">Strict Non-Submission & Anti-Plagiarism Clause</p> - <p class="text-neutral-600 text-xs mt-1">Copyright (c) 2025, AMIT DUTTA. All Rights Reserved.</p> - </div> - - <div class="space-y-6"> - <div> - <h5 class="font-bold text-white mb-2">1. DEFINITIONS</h5> - <ul class="list-disc pl-5 space-y-1"> - <li><strong>"The Software":</strong> Refers to all code, documentation, logic, and assets contained within this repository.</li> - <li><strong>"The Author":</strong> Refers to Amit Dutta.</li> - <li><strong>"Academic Use":</strong> Refers to the submission of code for grading, credit, or requirement fulfillment at any educational institution (specifically including, but not limited to, West Bengal State University).</li> - </ul> - </div> - - <div> - <h5 class="font-bold text-white mb-2">2. TERMS OF ACCESS (BINDING AGREEMENT)</h5> - <p>By accessing, downloading, cloning, or forking this repository, you agree to be bound by the terms of this License. If you do not agree to these terms, you are not permitted to use or view the Software and must delete all copies immediately.</p> - </div> - - <div> - <h5 class="font-bold text-white mb-2">3. LIMITED GRANT OF RIGHTS (REFERENCE ONLY)</h5> - <p>The Author grants you a revocable, non-exclusive license to:</p> - <ul class="list-disc pl-5 mt-1 space-y-1"> - <li>Read and study the code for personal learning and skill development.</li> - <li>Compile and run the code locally for testing and educational analysis.</li> - <li>Reference the underlying logic to create your OWN original implementation.</li> - </ul> - </div> - - <div class="bg-red-900/10 border border-red-900/30 rounded p-4"> - <h5 class="font-bold text-red-500 mb-2 flex items-center gap-2"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" /></svg> - 4. STRICT PROHIBITIONS (THE "ANTI-PLAGIARISM" CLAUSE) - </h5> - <p class="text-red-400 mb-2">The rights granted in Section 3 are strictly conditional. You are EXPRESSLY PROHIBITED from:</p> - <ul class="list-disc pl-5 space-y-1 text-red-400"> - <li>Copying, pasting, or modifying this Software (in whole or in part) for submission as your own academic work (assignments, labs, projects).</li> - <li>Removing this license or the copyright headers from any file to conceal the code's origin.</li> - <li>Redistributing this code on other platforms without the Author's written consent.</li> - </ul> - <p class="font-bold text-red-500 mt-3 text-sm uppercase">ANY VIOLATION OF SECTION 4 CONSTITUTES A BREACH OF COPYRIGHT AND ACADEMIC MISCONDUCT.</p> - </div> - - <div> - <h5 class="font-bold text-white mb-2">5. ENFORCEMENT & REPORTING</h5> - <p>The Author reserves the right to employ software forensics (including Git history and commit timestamps) to establish original ownership. The Author reserves the right to forward evidence of unauthorized use and license violation to:</p> - <ul class="list-disc pl-5 mt-1 space-y-1"> - <li>The Department Head / Faculty of the relevant institution.</li> - <li>The Examination Controller of the relevant University.</li> - <li>GitHub Trust & Safety (for DMCA Takedown and account suspension).</li> - </ul> - </div> - - <div> - <h5 class="font-bold text-white mb-2">6. NO WARRANTY</h5> - <p class="text-xs uppercase">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. THE AUTHOR BEARS NO LIABILITY FOR ACADEMIC PENALTIES INCURRED BY USERS WHO VIOLATE THEIR INSTITUTION'S ACADEMIC INTEGRITY POLICIES BY USING THIS CODE.</p> - </div> - - <div> - <h5 class="font-bold text-white mb-2">7. GOVERNING LAW</h5> - <p>Any legal disputes regarding the ownership or misuse of this code shall be subject to the laws of India and the jurisdiction of West Bengal.</p> - </div> - </div> - </div> - - <!-- Modal Footer --> - <div id="license-footer" class="px-6 py-4 border-t border-neutral-800 bg-[#111] rounded-b-xl flex justify-end shrink-0 gap-3"></div> - </div> - </div> - - <!-- Confirm Dialog Modal --> - <div id="confirm-modal" class="fixed inset-0 bg-black/80 backdrop-blur-sm hidden flex items-center justify-center z-[70] p-4 sm:p-6 opacity-0 transition-opacity duration-200"> - <div class="bg-[#111] w-full max-w-sm rounded-xl shadow-2xl flex flex-col border border-neutral-800 transform scale-95 transition-transform duration-200 p-6"> - <h3 class="text-lg font-bold text-white mb-2 font-heading">Clear Recent Files?</h3> - <p class="text-sm text-neutral-400 mb-6 font-mono">Are you sure you want to delete your recent file history? This action cannot be undone.</p> - <div class="flex justify-end gap-3"> - <button onclick="closeConfirmModal()" class="px-4 py-2 bg-neutral-900 hover:bg-neutral-800 text-neutral-300 text-sm font-medium rounded-lg transition-colors border border-neutral-700 font-mono">Cancel</button> - <button onclick="confirmClearRecentAction()" class="px-4 py-2 bg-red-900/50 hover:bg-red-900 text-red-200 hover:text-white text-sm font-medium rounded-lg transition-colors shadow-sm border border-red-900 font-mono">Delete</button> - </div> - </div> - </div> - - <!-- Toast Notification --> - <div id="toast" class="fixed bottom-4 right-4 bg-neutral-900 text-lime-300 px-4 py-2 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 z-[80] flex items-center gap-2 border border-lime-300/30"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> - <span class="font-mono text-xs uppercase">Link copied to clipboard!</span> - </div> - - <script> - function toggleFolder(header) { - if (header instanceof Event) header = header.currentTarget; - if (!header || typeof header.querySelector !== 'function') return; - - const content = header.nextElementSibling; - const icon = header.querySelector(".chevron"); - const folderIcon = header.querySelector(".folder-icon"); - - content.classList.toggle("hidden"); - icon.classList.toggle("rotated"); - - if (content.classList.contains("hidden")) { - folderIcon.innerHTML = `<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>`; - } else { - folderIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; - } - updateFolderState(); - } - - function updateFolderState() { - const folders = document.querySelectorAll('.folder-container'); - const total = folders.length; - let openCount = 0; - - folders.forEach(f => { - const content = f.children[1]; - if (!content.classList.contains('hidden')) openCount++; - }); - - const btnExpand = document.getElementById('btn-expand'); - const btnCollapse = document.getElementById('btn-collapse'); - - if (total === 0) { - setBtnState(btnExpand, false); - setBtnState(btnCollapse, false); - return; - } - - if (openCount === 0) { - setBtnState(btnExpand, true); - setBtnState(btnCollapse, false); - } else if (openCount === total) { - setBtnState(btnExpand, false); - setBtnState(btnCollapse, true); - } else { - setBtnState(btnExpand, true); - setBtnState(btnCollapse, true); - } - } - - function setBtnState(btn, isActive) { - if (isActive) { - btn.disabled = false; - btn.className = "text-xs font-bold text-lime-300 hover:bg-lime-300/10 px-3 py-1.5 rounded-md transition-all duration-200 cursor-pointer border border-lime-300/30 shadow-sm font-mono"; - } else { - btn.disabled = true; - btn.className = "text-xs font-bold text-neutral-600 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono"; - } - } - - function expandAll() { - document.querySelectorAll('.folder-container > div:nth-child(2)').forEach(content => { - content.classList.remove('hidden'); - }); - document.querySelectorAll('.folder-container .chevron').forEach(icon => { - icon.classList.add('rotated'); - }); - document.querySelectorAll('.folder-container .folder-icon').forEach(icon => { - icon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; - }); - updateFolderState(); - } - - function collapseAll() { - document.querySelectorAll('.folder-container > div:nth-child(2)').forEach(content => { - content.classList.add('hidden'); - }); - document.querySelectorAll('.folder-container .chevron').forEach(icon => { - icon.classList.remove('rotated'); - }); - document.querySelectorAll('.folder-container .folder-icon').forEach(icon => { - icon.innerHTML = `<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>`; - }); - updateFolderState(); - } - - const MAX_RECENT_FILES = 6; - let recentFiles = JSON.parse(localStorage.getItem('bsc_recent_files') || '[]'); - - function checkStorageExpiry() { - const now = Date.now(); - const setupTime = localStorage.getItem('bsc_setup_time'); - const threeDays = 3 * 24 * 60 * 60 * 1000; - - if (!setupTime) { - localStorage.setItem('bsc_setup_time', now); - } else { - if (now - parseInt(setupTime) > threeDays) { - localStorage.removeItem('license_accepted'); - localStorage.removeItem('bsc_recent_files'); - localStorage.setItem('bsc_setup_time', now); - recentFiles = []; - } - } - } - checkStorageExpiry(); - - function updateRecentFilesUI() { - const container = document.getElementById('recent-files-container'); - const list = document.getElementById('recent-files-list'); - - if (recentFiles.length === 0) { - container.classList.add('hidden'); - return; - } - - container.classList.remove('hidden'); - list.innerHTML = ''; - - recentFiles.forEach(file => { - const item = document.createElement('div'); - item.className = "flex items-center gap-2 px-3 py-2 bg-[#111] hover:bg-lime-300/10 hover:border-lime-300/30 border border-neutral-800 rounded-lg cursor-pointer transition-all group"; - item.onclick = () => showCode(file.storageId, file.name, file.url); - item.innerHTML = ` - <div class="p-1.5 rounded-md bg-lime-300/10 text-lime-300"> - <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - </div> - <span class="text-xs font-medium text-neutral-400 group-hover:text-white truncate font-mono">${file.name}</span> - `; - list.appendChild(item); - }); - } - - function addToRecent(storageId, name, url) { - recentFiles = recentFiles.filter(f => f.name !== name); - recentFiles.unshift({ storageId, name, url }); - if (recentFiles.length > MAX_RECENT_FILES) recentFiles.pop(); - localStorage.setItem('bsc_recent_files', JSON.stringify(recentFiles)); - updateRecentFilesUI(); - } - - const confirmModal = document.getElementById("confirm-modal"); - - function confirmClearRecent() { - confirmModal.classList.remove("hidden"); - void confirmModal.offsetWidth; - confirmModal.classList.remove("opacity-0"); - confirmModal.querySelector("div").classList.remove("scale-95"); - } - - function closeConfirmModal() { - confirmModal.classList.add("opacity-0"); - confirmModal.querySelector("div").classList.add("scale-95"); - setTimeout(() => { - confirmModal.classList.add("hidden"); - }, 200); - } - - function confirmClearRecentAction() { - recentFiles = []; - localStorage.setItem('bsc_recent_files', JSON.stringify(recentFiles)); - updateRecentFilesUI(); - closeConfirmModal(); - } - - updateRecentFilesUI(); - - const scrollContainer = document.getElementById('file-explorer-scroll'); - const backToTopBtn = document.getElementById('back-to-top'); - - scrollContainer.addEventListener('scroll', () => { - if (scrollContainer.scrollTop > 300) { - backToTopBtn.classList.remove('hidden'); - setTimeout(() => { - backToTopBtn.classList.remove('opacity-0', 'translate-y-4'); - }, 10); - } else { - backToTopBtn.classList.add('opacity-0', 'translate-y-4'); - setTimeout(() => { - if(scrollContainer.scrollTop <= 300) { - backToTopBtn.classList.add('hidden'); - } - }, 300); - } - }); - - function scrollToTop() { - scrollContainer.scrollTo({ - top: 0, - behavior: 'smooth' - }); - } - - function showToast() { - const toast = document.getElementById("toast"); - toast.classList.remove("hidden"); - void toast.offsetWidth; - toast.classList.add("show", "translate-y-0", "opacity-100"); - toast.classList.remove("translate-y-20", "opacity-0"); - - setTimeout(() => { - toast.classList.remove("show", "translate-y-0", "opacity-100"); - toast.classList.add("translate-y-20", "opacity-0"); - setTimeout(() => { - toast.classList.add("hidden"); - }, 300); - }, 3000); - } - - /* --- Code Modal Logic with CodeMirror --- */ - const modal = document.getElementById("code-modal"); - const modalFilename = document.getElementById("modal-filename"); - const modalFileSize = document.getElementById("modal-filesize"); - const modalRawLink = document.getElementById("modal-raw-link"); - const loadingSpinner = document.getElementById("code-loading"); - const newTabBtn = document.getElementById("new-tab-btn"); - const mobileGithubLink = document.getElementById("mobile-github-link"); - - let currentFileUrl = ""; - let editor = null; - - function detectMode(filename) { - if (filename.endsWith('.c')) return 'text/x-csrc'; - if (filename.endsWith('.cpp') || filename.endsWith('.h')) return 'text/x-c++src'; - if (filename.endsWith('.py')) return 'text/x-python'; - if (filename.endsWith('.js')) return 'text/javascript'; - if (filename.endsWith('.html') || filename.endsWith('.xml')) return 'text/html'; - return 'text/plain'; - } - - function showCode(storageId, filename, rawUrl) { - currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename); - modal.classList.remove("hidden"); - void modal.offsetWidth; - modal.classList.remove("opacity-0"); - modal.querySelector("div").classList.remove("scale-95"); - - modalFilename.textContent = filename; - modalRawLink.href = rawUrl; - if(mobileGithubLink) mobileGithubLink.href = rawUrl; - - addToRecent(storageId, filename, rawUrl); - - const storedContent = document.getElementById(storageId); - let code = ""; - - if (storedContent) { - code = storedContent.textContent; - - const bytes = new Blob([code]).size; - const sizeStr = bytes > 1024 ? (bytes/1024).toFixed(2) + " KB" : bytes + " B"; - modalFileSize.textContent = sizeStr; - - newTabBtn.onclick = () => { - const newWindow = window.open(); - newWindow.document.write('<html><head><title>' + filename + '</title>'); - newWindow.document.write('<style>body{font-family: monospace; white-space: pre-wrap; padding: 20px; background: #0d1117; color: #e6edf3;} </style>'); - newWindow.document.write('</head><body><pre>' + code.replace(/</g, "&lt;").replace(/>/g, "&gt;") + '</pre></body></html>'); - newWindow.document.close(); - }; - - } else { - code = "// Error: Content not found"; - modalFileSize.textContent = ""; - } - - const mode = detectMode(filename); - - if (!editor) { - editor = CodeMirror(document.getElementById("modal-code-container"), { - value: code, - mode: mode, - theme: "dracula", - lineNumbers: true, - readOnly: true, - styleActiveLine: true - }); - } else { - editor.setValue(code); - editor.setOption("mode", mode); - } - - setTimeout(() => editor.refresh(), 10); - - const newUrl = new URL(window.location); - newUrl.searchParams.set('file', filename); - window.history.pushState({ path: newUrl.href }, '', newUrl.href); - } - - function hideCode() { - // Close mobile menu if open - const dropdown = document.getElementById('mobile-menu-dropdown'); - if (!dropdown.classList.contains('hidden')) { - dropdown.classList.add('hidden'); - } - - modal.classList.add("opacity-0"); - modal.querySelector("div").classList.add("scale-95"); - - setTimeout(() => { - modal.classList.add("hidden"); - if(editor) editor.setValue(""); - }, 200); - - const newUrl = new URL(window.location); - newUrl.searchParams.delete('file'); - window.history.pushState({ path: newUrl.href }, '', newUrl.href); - } - - const downloadBtn = document.getElementById("download-btn"); - downloadBtn.addEventListener("click", () => { - const filename = modalFilename.textContent; - const content = editor ? editor.getValue() : ""; - - const element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content)); - element.setAttribute('download', filename); - - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); - }); - - function printCode() { - const content = editor ? editor.getValue() : ""; - const filename = document.getElementById('modal-filename').textContent; - - const printWindow = window.open('', '', 'height=600,width=800'); - printWindow.document.write('<html><head><title>' + filename + '</title>'); - printWindow.document.write('<style>body{font-family: monospace; white-space: pre-wrap; padding: 20px;} </style>'); - printWindow.document.write('</head><body>'); - const safeContent = content.replace(/</g, "&lt;").replace(/>/g, "&gt;"); - printWindow.document.write('<pre>' + safeContent + '</pre>'); - printWindow.document.write('</body></html>'); - printWindow.document.close(); - printWindow.focus(); - printWindow.print(); - } - - /* --- NEW COMPILER FEATURE --- */ - function openInCompiler() { - const codeText = editor ? editor.getValue() : ""; - if (!codeText) return; - - // Compress using LZ-String - const compressed = LZString.compressToEncodedURIComponent(codeText); - const url = `https://compiler.amit.is-a.dev/c?code=${compressed}`; - - window.open(url, '_blank'); - } - - /* --- NEW MOBILE MENU --- */ - function toggleMobileMenu(e) { - e.stopPropagation(); - const dropdown = document.getElementById('mobile-menu-dropdown'); - dropdown.classList.toggle('hidden'); - } - - // Close mobile menu when clicking outside - document.addEventListener('click', function(e) { - const dropdown = document.getElementById('mobile-menu-dropdown'); - const btn = document.getElementById('mobile-menu-btn'); - - if (!dropdown.classList.contains('hidden') && !btn.contains(e.target) && !dropdown.contains(e.target)) { - dropdown.classList.add('hidden'); - } - }); - - /* --- License Modal Logic --- */ - const licenseModal = document.getElementById("license-modal"); - const licenseFooter = document.getElementById("license-footer"); - const licenseCloseBtn = document.getElementById("license-close-btn"); - const appContent = document.getElementById("app-content"); - - function openLicenseModal(forced) { - licenseModal.classList.remove("hidden"); - void licenseModal.offsetWidth; - licenseModal.classList.remove("opacity-0"); - licenseModal.querySelector("div").classList.remove("scale-95"); - - licenseFooter.innerHTML = ""; - - if (forced) { - licenseCloseBtn.classList.add("hidden"); - - const btnDecline = document.createElement("button"); - btnDecline.className = "px-4 py-2 bg-neutral-900 hover:bg-red-900/20 text-neutral-400 hover:text-red-400 text-sm font-medium rounded-lg transition-colors border border-neutral-700 font-mono"; - btnDecline.innerText = "Decline"; - btnDecline.onclick = declineLicense; - - const btnAccept = document.createElement("button"); - btnAccept.className = "px-4 py-2 bg-lime-300 hover:bg-lime-400 text-black text-sm font-bold rounded-lg transition-colors shadow-sm font-mono"; - btnAccept.innerText = "Accept"; - btnAccept.onclick = acceptLicense; - - licenseFooter.appendChild(btnDecline); - licenseFooter.appendChild(btnAccept); - } else { - licenseCloseBtn.classList.remove("hidden"); - - const btnUnderstand = document.createElement("button"); - btnUnderstand.className = "px-4 py-2 bg-neutral-900 hover:bg-neutral-800 text-white text-sm font-medium rounded-lg transition-colors shadow-sm border border-neutral-700 font-mono"; - btnUnderstand.innerText = "I Understand"; - btnUnderstand.onclick = hideLicense; - - licenseFooter.appendChild(btnUnderstand); - } - } - - function hideLicense() { - licenseModal.classList.add("opacity-0"); - licenseModal.querySelector("div").classList.add("scale-95"); - setTimeout(() => { - licenseModal.classList.add("hidden"); - }, 200); - } - - function acceptLicense() { - localStorage.setItem("license_accepted", "true"); - hideLicense(); - appContent.style.display = "flex"; - } - - function declineLicense() { - document.documentElement.innerHTML = ""; - if (window.history.length > 1) { - window.history.back(); - } else { - window.close(); - } - } - - function checkLicense() { - const accepted = localStorage.getItem("license_accepted"); - if (accepted === "true") { - appContent.style.display = "flex"; - } else { - openLicenseModal(true); - } - } - - document.addEventListener("keydown", (e) => { - if (e.key === "Escape" && !licenseModal.classList.contains("hidden")) { - if (!licenseCloseBtn.classList.contains("hidden")) { - hideLicense(); - } - } - }); - - licenseModal.addEventListener("click", (e) => { - if (e.target === licenseModal) { - if (!licenseCloseBtn.classList.contains("hidden")) { - hideLicense(); - } - } - }); - - checkLicense(); - - /* --- Search Logic --- */ - let searchIndex = []; - - function buildSearchIndex() { - searchIndex = []; - const fileElements = document.querySelectorAll(".file-item"); - fileElements.forEach((el) => { - const name = el.querySelector("span").textContent.toLowerCase().trim(); - const parentContent = el.closest(".pl-4"); - - const codeDiv = el.querySelector("div[id^='code-']"); - const code = codeDiv ? codeDiv.textContent.toLowerCase() : ""; - - const storageId = codeDiv ? codeDiv.id : ""; - - searchIndex.push({ name, code, element: el, parent: parentContent, storageId }); - }); - } - - const searchInput = document.getElementById("search-input"); - - function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - } - - searchInput.addEventListener("input", (e) => { - const query = e.target.value.toLowerCase(); - - document.querySelectorAll('.search-snippet').forEach(el => el.remove()); - document.querySelectorAll('.file-item').forEach(el => { - el.classList.remove('flex-wrap', 'pb-2'); - el.classList.remove('nav-selected'); - }); - - selectedFileIndex = -1; - - if (searchIndex.length === 0) buildSearchIndex(); - - if (!query) { - document.querySelectorAll('.file-item, .folder-container').forEach(el => el.classList.remove('hidden')); - updateFolderState(); - return; - } - - document.querySelectorAll('.file-item').forEach(el => el.classList.add('hidden')); - document.querySelectorAll('.folder-container').forEach(el => el.classList.add('hidden')); - - searchIndex.forEach(item => { - const nameMatch = item.name.includes(query); - const codeMatch = item.code.includes(query); - - if (nameMatch || codeMatch) { - item.element.classList.remove('hidden'); - - let parent = item.element.parentElement; - while(parent && parent.id !== "file-list-container") { - parent.classList.remove('hidden'); - if (parent.previousElementSibling) { - const folderContainer = parent.parentElement; - if(folderContainer.classList.contains('folder-container')) { - folderContainer.classList.remove('hidden'); - } - - if(parent.classList.contains('hidden')) { - const chevron = parent.previousElementSibling.querySelector('.chevron'); - if(chevron && !chevron.classList.contains('rotated')) { - chevron.classList.add('rotated'); - } - const fIcon = parent.previousElementSibling.querySelector('.folder-icon'); - if(fIcon) fIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; - } - } - parent = parent.parentElement; - } - - if (codeMatch) { - const originalCodeDiv = item.element.querySelector("div[id^='code-']"); - if (originalCodeDiv) { - const originalCode = originalCodeDiv.textContent; - const matchIndex = item.code.indexOf(query); - - if (matchIndex !== -1) { - const codePreMatch = item.code.substring(0, matchIndex); - const lineCount = (codePreMatch.match(/\n/g) || []).length; - - const allLines = originalCode.split('\n'); - const startLine = Math.max(0, lineCount - 2); - const endLine = Math.min(allLines.length, lineCount + 3); - - const snippetLines = allLines.slice(startLine, endLine); - - const snippetDiv = document.createElement('div'); - snippetDiv.className = 'search-snippet w-full mt-2 ml-4 sm:ml-7 p-2 bg-[#111] border-l-4 border-lime-300 rounded-r text-xs font-mono text-neutral-400 overflow-x-auto shadow-sm cursor-pointer hover:bg-neutral-900 transition-colors'; - - snippetDiv.onclick = (evt) => { - evt.stopPropagation(); - const rawUrl = item.element.querySelector(".flex-1").getAttribute('onclick').match(/'([^']*)'\)$/)[1]; - showCode(item.storageId, item.element.querySelector("span").textContent, rawUrl); - }; - - let htmlContent = ''; - const safeQuery = escapeRegExp(query); - const highlightRegex = new RegExp(`(${safeQuery})`, 'gi'); - - snippetLines.forEach((line, idx) => { - const currentLineNum = startLine + idx + 1; - let safeLine = line.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;"); - safeLine = safeLine.replace(highlightRegex, '<mark class="bg-lime-300 text-black font-bold rounded-sm px-0.5">$1</mark>'); - - const isMatchLine = (currentLineNum - 1) === lineCount; - const lineClass = isMatchLine ? 'bg-lime-300/10 font-semibold' : ''; - - htmlContent += `<div class="whitespace-pre ${lineClass}"><span class="inline-block w-8 text-right mr-3 text-neutral-600 select-none border-r border-neutral-700 pr-1">${currentLineNum}</span>${safeLine}</div>`; - }); - - snippetDiv.innerHTML = htmlContent; - item.element.classList.add('flex-wrap', 'pb-2'); - item.element.appendChild(snippetDiv); - } - } - } - } - }); - }); - - let selectedFileIndex = -1; - - function handleKeyboardNav(e) { - if (!modal.classList.contains("hidden")) return; - - const visibleFiles = Array.from(document.querySelectorAll('.file-item:not(.hidden)')); - if (visibleFiles.length === 0) return; - - if (e.key === 'ArrowDown') { - e.preventDefault(); - selectedFileIndex = (selectedFileIndex + 1) % visibleFiles.length; - updateSelection(visibleFiles); - } else if (e.key === 'ArrowUp') { - e.preventDefault(); - selectedFileIndex = (selectedFileIndex - 1 + visibleFiles.length) % visibleFiles.length; - updateSelection(visibleFiles); - } else if (e.key === 'Enter' && selectedFileIndex !== -1) { - e.preventDefault(); - const clickTarget = visibleFiles[selectedFileIndex].querySelector('.flex-1'); - if (clickTarget) clickTarget.click(); - } - } - - function updateSelection(files) { - files.forEach(el => el.classList.remove('nav-selected')); - if (selectedFileIndex >= 0 && selectedFileIndex < files.length) { - const selectedEl = files[selectedFileIndex]; - selectedEl.classList.add('nav-selected'); - selectedEl.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); - } - } - - function animateSuccess(btn, defaultIcon, successIcon) { - defaultIcon.classList.add("hidden", "scale-0"); - successIcon.classList.remove("hidden", "scale-0"); - - setTimeout(() => { - successIcon.classList.add("hidden", "scale-0"); - defaultIcon.classList.remove("hidden", "scale-0"); - }, 2000); - } - - document.addEventListener("DOMContentLoaded", () => { - updateFolderState(); - - const params = new URLSearchParams(window.location.search); - const sharedFile = params.get('file'); - if (sharedFile) { - const fileElements = document.querySelectorAll(".file-item"); - for (let el of fileElements) { - const nameSpan = el.querySelector("span"); - if (nameSpan && nameSpan.textContent.trim() === sharedFile) { - const clickable = el.querySelector(".flex-1"); - - let parentContent = el.closest('.pl-4'); - while (parentContent) { - parentContent.classList.remove('hidden'); - const folderHeader = parentContent.previousElementSibling; - if (folderHeader) { - const chevron = folderHeader.querySelector('.chevron'); - const folderIcon = folderHeader.querySelector('.folder-icon'); - if (chevron) chevron.classList.add('rotated'); - if (folderIcon) folderIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; - } - parentContent = parentContent.parentElement.closest('.pl-4'); - } - - if (clickable) { - clickable.click(); - setTimeout(() => { - el.scrollIntoView({ behavior: 'smooth', block: 'center' }); - }, 300); - } - break; - } - } - } - - const shareBtn = document.getElementById("share-btn"); - const shareIconDefault = document.getElementById("share-icon-default"); - const shareIconSuccess = document.getElementById("share-icon-success"); - - shareBtn.addEventListener("click", async () => { - if (!currentFileUrl) return; - - const shareData = { - title: modalFilename.textContent, - text: `Check out this code,\nFile: ${modalFilename.textContent}\nLink: `, - url: currentFileUrl, - }; - - if (navigator.share) { - try { - await navigator.share(shareData); - } catch (err) { - if (err.name !== "AbortError") { - console.error("Share failed:", err.message); - } - } - } else { - navigator.clipboard.writeText(currentFileUrl).then(() => { - animateSuccess(shareBtn, shareIconDefault, shareIconSuccess); - showToast(); - }); - } - }); - - const copyCodeBtn = document.getElementById("copy-code-btn"); - const copyIconDefault = document.getElementById("copy-icon-default"); - const copyIconSuccess = document.getElementById("copy-icon-success"); - - copyCodeBtn.addEventListener("click", () => { - const codeText = editor ? editor.getValue() : ""; - navigator.clipboard.writeText(codeText).then(() => { - animateSuccess(copyCodeBtn, copyIconDefault, copyIconSuccess); - }).catch(err => { - console.error('Failed to copy code: ', err); - }); - }); - - document.addEventListener("keydown", (e) => { - const searchInput = document.getElementById("search-input"); - if (e.key === "Escape" && !modal.classList.contains("hidden")) { - hideCode(); - return; - } - if ( - e.key === "/" && - modal.classList.contains("hidden") && - !/^(INPUT|TEXTAREA|SELECT)$/i.test(document.activeElement.tagName) - ) { - e.preventDefault(); - searchInput.focus(); - } - }); - }); - </script> - </body> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <!-- Fix favicon 404 error --> + <link rel="icon" href="data:,"> + <title>notamitgamer/bsc Repository File Index</title> + + <!-- Fonts --> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> + + <!-- Tailwind CSS with Kinetic Terminal Configuration --> + <script src="https://cdn.tailwindcss.com"></script> + <script> + tailwind.config = { + theme: { + extend: { + fontFamily: { + sans: ['Inter', 'sans-serif'], + mono: ['JetBrains Mono', 'monospace'], + heading: ['Space Grotesk', 'sans-serif'], + }, + colors: { + blue: { + 50: 'rgba(190, 242, 100, 0.05)', + 100: 'rgba(190, 242, 100, 0.1)', + 200: '#d9f99d', + 300: '#bef264', + 400: '#a3d656', + 500: '#bef264', + 600: '#bef264', + 700: '#84cc16', + 800: '#3f6212', + 900: '#365314', + }, + slate: { + 50: '#050505', + 100: '#111111', + 200: '#27272a', + 300: '#404040', + 400: '#525252', + 500: '#737373', + 600: '#a1a1aa', + 700: '#d4d4d8', + 800: '#e4e4e7', + 900: '#f5f5f5', + } + } + } + } + } + </script> + + <!-- CodeMirror 5 (Professional Editor) --> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/dracula.min.css"> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/clike/clike.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/python/python.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/xml/xml.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/htmlmixed/htmlmixed.min.js"></script> + + <!-- LZ-String Compression --> + <script src="https://cdn.jsdelivr.net/npm/lz-string@1.5.0/libs/lz-string.min.js"></script> + + <style> + :root { + --bg-main: #050505; + --accent: #bef264; + --border-color: #27272a; + --text-main: #f5f5f5; + --text-muted: #737373; + } + + body { + font-family: "Inter", sans-serif; + background-color: var(--bg-main); + color: var(--text-main); + } + + h1, h2, h3, .font-heading { font-family: 'Space Grotesk', sans-serif; } + + /* Noise Texture */ + .bg-noise { + position: fixed; top: 0; left: 0; width: 100%; height: 100%; + pointer-events: none; z-index: 0; opacity: 0.03; + background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); + } + + /* CRT Scanline */ + .crt-scanline { + position: fixed; top: 0; left: 0; width: 100%; height: 2px; + background: rgba(190, 242, 100, 0.1); opacity: 0.5; + pointer-events: none; z-index: 50; + animation: scanline 8s linear infinite; + } + @keyframes scanline { 0% { top: -10vh; } 100% { top: 110vh; } } + + .chevron.rotated { + transform: rotate(180deg); + } + + .file-item:hover { + background-color: rgba(190, 242, 100, 0.05) !important; + border-color: rgba(190, 242, 100, 0.2) !important; + } + .folder-container > div:first-child:hover { + background-color: #111111 !important; + } + + .text-slate-700 { color: #d4d4d8 !important; } + .text-slate-600 { color: #a1a1aa !important; } + .text-slate-500 { color: #737373 !important; } + + #code-modal .modal-content-area { + height: 85vh; + max-height: 90vh; + background-color: #0d1117 !important; + border: 1px solid #30363d; + } + @media (min-width: 640px) { + #code-modal .modal-content-area { + height: 90vh; + } + } + + #modal-code-container { + padding: 0; + margin: 0; + height: 100%; + overflow: hidden; /* CodeMirror handles scroll */ + position: relative; + } + + /* CodeMirror Overrides */ + .CodeMirror { + height: 100% !important; + font-family: 'JetBrains Mono', monospace; + font-size: 13px; + background-color: #0d1117 !important; + color: #f8f8f2; + } + .CodeMirror-gutters { + background-color: #0d1117 !important; + border-right: 1px solid rgba(255,255,255,0.1) !important; + } + .CodeMirror-linenumber { + color: #6e7681 !important; + } + .CodeMirror-cursor { + border-left: 2px solid var(--accent) !important; + } + .CodeMirror-selected { + background: rgba(190, 242, 100, 0.2) !important; + } + + /* Scrollbar styling */ + .CodeMirror-scroll::-webkit-scrollbar, + ::-webkit-scrollbar { width: 10px; height: 10px; } + .CodeMirror-scroll::-webkit-scrollbar-track, + ::-webkit-scrollbar-track { background: #050505; } + .CodeMirror-scroll::-webkit-scrollbar-thumb, + ::-webkit-scrollbar-thumb { background: #27272a; border-radius: 5px; border: 2px solid #050505; } + .CodeMirror-scroll::-webkit-scrollbar-thumb:hover, + ::-webkit-scrollbar-thumb:hover { background: #bef264; } + + #app-content { display: none; } + + #back-to-top { transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; } + #back-to-top.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); } + + #toast { transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); } + #toast.show { transform: translateY(0); opacity: 1; } + + .file-item.nav-selected { background-color: rgba(190, 242, 100, 0.1) !important; border-color: #bef264 !important; } + .file-item.nav-selected span { color: #bef264 !important; } + + #modal-filename { color: #e6edf3; } + #code-loading { background-color: #0d1117; } + </style> + </head> + <body class="bg-slate-50 text-slate-900 h-screen flex flex-col overflow-hidden relative selection:bg-lime-300 selection:text-black"> + + <div class="bg-noise"></div> + <div class="crt-scanline"></div> + + <!-- App Wrapper --> + <div id="app-content" class="flex flex-col h-full overflow-hidden relative z-10"> + <!-- Header --> + <header + class="bg-[#050505]/90 backdrop-blur-md border-b border-white/10 px-4 sm:px-6 py-3 sm:py-4 flex flex-col sm:flex-row items-start sm:items-center justify-between shrink-0 shadow-sm z-10 gap-4 sm:gap-0 sticky top-0" + > + <!-- Logo Section --> + <div class="flex items-center gap-3 w-full sm:w-auto justify-between"> + <div class="flex items-center gap-3"> + <div class="p-2 bg-lime-300/10 rounded-lg shrink-0 border border-lime-300/20"> + <svg class="w-6 h-6 text-lime-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path> + </svg> + </div> + <div class="min-w-0"> + <h1 class="text-lg sm:text-xl font-bold text-white tracking-tight truncate font-heading">notamitgamer/bsc</h1> + <p class="text-xs text-neutral-500 font-medium mt-0.5 truncate font-mono">Repository File Index</p> + </div> + </div> + + <div class="flex items-center gap-2 sm:hidden"> + <button onclick="openLicenseModal(false)" class="p-2 text-neutral-400 hover:text-lime-300 bg-neutral-900 rounded-md transition-colors border border-neutral-800" title="View License"> + <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" /> + </svg> + </button> + <a href="https://github.com/notamitgamer/bsc" target="_blank" class="text-neutral-400 hover:text-white"> + <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + </div> + + <!-- Actions Section --> + <div class="flex items-center gap-3 w-full sm:w-auto flex-wrap sm:flex-nowrap"> + <button onclick="openLicenseModal(false)" class="hidden sm:flex items-center gap-2 px-3 py-2 text-sm font-medium text-neutral-400 hover:text-lime-300 hover:bg-lime-300/10 rounded-md transition-colors shrink-0 font-mono border border-transparent hover:border-lime-300/20" title="View License"> + <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" /></svg> + <span class="inline">License</span> + </button> + + <div class="relative group grow sm:grow-0 w-full sm:w-auto"> + <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> + <svg class="h-4 w-4 text-neutral-500 group-focus-within:text-lime-300 transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> + </div> + <input type="text" id="search-input" placeholder="Search code... (/)" class="pl-10 pr-10 sm:pr-4 py-2 bg-[#111] border border-neutral-800 rounded-lg text-sm w-full sm:w-64 focus:ring-1 focus:ring-lime-300/50 focus:border-lime-300/50 focus:bg-[#050505] transition-all outline-none text-neutral-200 placeholder:text-neutral-600 font-mono"/> + <div class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none hidden sm:flex"> + <span class="text-[10px] text-neutral-600 font-mono border border-neutral-800 rounded px-1.5 py-0.5 bg-[#111]">/</span> + </div> + </div> + + <a href="https://github.com/notamitgamer/bsc" target="_blank" class="hidden sm:flex bg-neutral-100 hover:bg-lime-300 text-black px-4 py-2 rounded-lg text-sm font-medium transition-all shadow-sm items-center gap-2 font-mono"> + <span>GitHub</span> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + </header> + + <!-- Main Content Area --> + <main class="flex-1 flex overflow-hidden relative" id="main-scroll-container"> + <!-- File Explorer --> + <div class="flex-1 overflow-y-auto p-4 sm:p-6 h-full" id="file-explorer-scroll"> + <div class="max-w-4xl mx-auto space-y-4"> + <div id="recent-files-container" class="hidden mb-6"> + <div class="flex items-center justify-between mb-3 px-1"> + <h2 class="text-xs font-bold text-neutral-500 uppercase tracking-wider font-mono">Recent Files</h2> + <button onclick="confirmClearRecent()" class="text-xs text-red-400 hover:text-red-500 font-medium transition-colors hover:underline font-mono">Clear</button> + </div> + <div id="recent-files-list" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2"></div> + <hr class="mt-4 border-white/10"> + </div> + + <div class="sticky top-0 z-20 bg-[#050505] py-2 flex justify-end gap-2 border-b border-white/10 backdrop-blur-sm bg-opacity-90 mb-2"> + <button id="btn-expand" onclick="expandAll()" class="text-xs font-bold text-neutral-500 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono" disabled>Expand All</button> + <span class="text-neutral-700">|</span> + <button id="btn-collapse" onclick="collapseAll()" class="text-xs font-bold text-neutral-500 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono" disabled>Collapse All</button> + </div> + + <div id="file-list-container"> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">Semester_1</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">assignment-primary</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-01-c', 'assignment-p-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-01.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-01.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-01-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named isPrime with the signature +int isPrime(int num); The function should take an integer as a parameter and return 1 if +the number is prime and 0 otherwise. */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int isPrime(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + + if (isPrime(n)) + { + printf(&quot;\nInput %d is a Prime Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is not a Prime Number.&quot;, n); + } + + return 0; +} + +int isPrime(int n) +{ + if (n &lt;= 1) + return 0; + if (n == 2) + return 1; + if (n % 2 == 0) + return 0; + + int temp = (int)sqrt(n); + int i; + for (i = 3; i &lt;= temp; i += 2) + { + if (n % i == 0) + { + return 0; + } + } + return 1; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-02-c', 'assignment-p-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-02.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-02.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-02-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named isArmstrong with the +signature int isArmstrong(int num);. An Armstrong number is a number that is equal to +the sum of its own digits each raised to the power of the number of digits. For example, +153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int isArmstrong(int); +int count(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + + if (isArmstrong(n)) + { + printf(&quot;\nInput %d is a Armstrong Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is Not a Armstrong Number.&quot;, n); + } + + return 0; +} + +int count(int n) +{ + int count = 0; + while (n &gt; 0) + { + count++; + n = n / 10; + } + return count; +} + +int isArmstrong(int n) +{ + if (n &lt; 0) + return 0; + if (n == 0) + return 1; + + int power = count(n); + int temp = n; + int checker = 0; + + while (temp &gt; 0) + { + int digit = temp % 10; + checker = checker + (int)round(pow(digit, power)); + temp = temp / 10; + } + return n == checker; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-03-c', 'assignment-p-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-03.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-03.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-03-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named isPerfect with the signature +int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of +its proper divisors, excluding itself. For example, 28 is a perfect number because the sum +of its divisors (1, 2, 4, 7, 14) equals 28. */ + +#include &lt;stdio.h&gt; + +int isPerfect(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (isPerfect(n)) + { + printf(&quot;\nInput %d is a Perfect Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is not a Perfect Number.&quot;, n); + } + return 0; +} + +int isPerfect(int n) +{ + if (n &lt;= 1) + return 0; + int temp = 1; + int i; + for (i = 2; i &lt;= n / 2; i++) + { + if (n % i == 0) + { + temp += i; + } + } + return temp == n; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-04-c', 'assignment-p-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-04.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-04.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-04-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that takes an integer input representing a month (1 to 12) and a year. +Use a switch statement to display the number of days in that month, considering leap years. */ + +#include &lt;stdio.h&gt; + +int main() +{ + int month, year, days; + printf(&quot;Enter the month (1 to 12) and year: &quot;); + scanf(&quot;%d %d&quot;, &amp;month, &amp;year); + + switch (month) + { + case 1: // jan + case 3: // mar + case 5: // may + case 7: // july + case 8: // aug + case 10: // oct + case 12: // dec + days = 31; + break; + case 4: // apr + case 6: // jun + case 9: // sep + case 11: // nov + days = 30; + break; + case 2: // feb + if ((year % 400 == 0) || ((year % 4 == 0) &amp;&amp; (year % 100 != 0))) + { + days = 29; + } + else + { + days = 28; + } + break; + default: + printf(&quot;\nYou entered something wrong.&quot;); + return 0; + } + + printf(&quot;\nNumber of days: %d&quot;, days); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-05-c', 'assignment-p-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-05.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-05.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-05-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that defines an array of integers, and includes a user-defined function +named reverseArray with the signature void reverseArray(int arr[], int size);. The function +should reverse the elements of the array. */ + +#include &lt;stdio.h&gt; + +void inputArray(int[], int); +void reverseArray(int[], int); + +int main() +{ + int size; + printf(&quot;How many element do you want to add: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + inputArray(arr, size); + reverseArray(arr, size); + return 0; +} + +void inputArray(int arr[], int size) +{ + int i; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +void reverseArray(int arr[], int size) +{ + int i, j, temp; + printf(&quot;\nBefore Reverse: \n&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); + } + for (i = 0, j = size - 1; i &lt; j; i++, j--) + { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + printf(&quot;\nAfter Reverse: \n&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-06-c', 'assignment-p-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-06.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-06.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-06-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named findLargest with the +signature int findLargest(int arr[], int size);. The function should take an array of integers +and its size, and return the largest element in the array. */ + +#include &lt;stdio.h&gt; + +void inputArray(int[], int); +int findLargest(int[], int); + +int main() +{ + int size; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + inputArray(arr, size); + printf(&quot;\nLargest Element is: %d&quot;, findLargest(arr, size)); + return 0; +} + +void inputArray(int arr[], int size) +{ + int i; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int findLargest(int arr[], int size) +{ + int largest = arr[0], i; + for (i = 1; i &lt; size; i++) + { + if (largest &lt; arr[i]) + { + largest = arr[i]; + } + } + return largest; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-07-c', 'assignment-p-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-07.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-07.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-07-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named binarySearch with the +signature int binarySearch(int arr[], int size, int target);. The function should perform a +binary search on a sorted array of integers and return the index of the target element if +found, and -1 otherwise. */ + +#include &lt;stdio.h&gt; + +int inputArray(int[], int); +// void sortArray(int[], int); +int binarySearch(int[], int, int); + +int main() +{ + int size; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + int target = inputArray(arr, size); + // sortArray(arr, size); + int index = binarySearch(arr, size, target); + if (index != -1) + { + printf(&quot;\nElement %d is found at index %d.&quot;, target, index); + } + else + { + printf(&quot;\nElement %d is not found.&quot;, target); + } + return 0; +} + +int inputArray(int arr[], int size) +{ + int i, target; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element for position %d: &quot;, i); + scanf(&quot;%d&quot;, &amp;arr[i]); + } + printf(&quot;\nEnter the target element: &quot;); + scanf(&quot;%d&quot;, &amp;target); + return target; +} + +/* void sortArray(int arr[], int size) +{ + // using Bubble Sort... + + int tempArr[size], i, j, temp; + printf(&quot;\nBefore Sorting:\n[&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i != size - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]\n&quot;); + for (i = 0; i &lt; size - 1; i++) + { + for (j = 0; j &lt; size - i - 1; j++) + { + if (arr[j] &gt; arr[j + 1]) + { + temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + } + printf(&quot;\nAfter Sorting:\n[&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i != size - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]\n&quot;); +} +*/ + +int binarySearch(int arr[], int size, int target) +{ + int low = 0; + int high = size - 1; + int mid; + while (low &lt;= high) + { + mid = low + ((high - low) / 2); + if (arr[mid] == target) + { + return mid; + } + else if (arr[mid] &gt; target) + { + high = mid - 1; + } + else if (arr[mid] &lt; target) + { + low = mid + 1; + } + } + return -1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-08-c', 'assignment-p-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-08.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-08.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-08-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named countSetBits with the +signature int countSetBits(int num);. The function should count and return the number of +set bits (1s) in the binary representation of the given number. */ + +#include &lt;stdio.h&gt; + +int countSetBits(int); + +int main() +{ + int num, result; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (result = countSetBits(num)) + { + printf(&quot;\nNumber of set bits in %d: %d&quot;, num, result); + } + else + { + printf(&quot;\nThere is no set bits in %d&quot;, num); + } + return 0; +} + +int countSetBits(int num) +{ + int count = 0; + int mask= 1; + int i = 1; + while (i &lt;= 16) + { + if (num &amp; mask) + { + count++; + } + mask &lt;&lt;= 1; + i++; + } + return count; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-09-c', 'assignment-p-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-09.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-09.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-09-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named setBit with the signature +int setBit(int num, int position);. The function should set the bit at the specified position +(0-indexed) to 1 and return the modified number. */ + +#include &lt;stdio.h&gt; + +int setBit(int, int); + +int main() +{ + int num, position; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;num); + printf(&quot;Enter the postion where you want to set the bit (0-indexed): &quot;); + scanf(&quot;%d&quot;, &amp;position); + printf(&quot;\nModified number= %d&quot;, setBit(num, position)); + return 0; +} + +int setBit(int num, int position) +{ + int mask = 1 &lt;&lt; position; + return num | mask; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-10-c', 'assignment-p-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-10.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-10.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-10-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that defines a structure Rectangle with attributes length and width. +Include a user-defined function named calculateArea with the signature float +calculateArea(struct Rectangle r);. The function should calculate and return the area of +the rectangle. */ + +#include &lt;stdio.h&gt; + +struct Rectangle +{ + float length; + float width; +}; + +float calculateArea(struct Rectangle); + +int main() +{ + struct Rectangle rec; + printf(&quot;Enter the length of the Rectangle: &quot;); + scanf(&quot;%f&quot;, &amp;rec.length); + printf(&quot;Enter the width of the Rectangle: &quot;); + scanf(&quot;%f&quot;, &amp;rec.width); + printf(&quot;\nArea of the Rectangle = %g&quot;, calculateArea(rec)); +} + +float calculateArea(struct Rectangle r) +{ + return r.length * r.width; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-11-c', 'assignment-p-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-11.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-11-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that defines a structure Student containing the attributes rollNumber, +name, and marks. Include a user-defined function named displayStudent with the +signature void displayStudent(struct Student s);. The function should display the details +of a student. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; +#include &lt;stdlib.h&gt; + +struct Student +{ + int rollNumber; + char name[50]; + float marks; +}; + +void inputStudent(struct Student *); +void displayStudent(struct Student); + +int main() +{ + struct Student *std = NULL; + int i, n; + + printf(&quot;How many student details you want to add : &quot;); + if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) + { + printf(&quot;\nInvalid Input.&quot;); + return 1; + } + + std = (struct Student *)malloc(n * sizeof(struct Student)); + if (std == NULL) + { + printf(&quot;\nUnable to allocate memory.&quot;); + return 1; + } + + for (i = 0; i &lt; n; i++) + { + printf(&quot;\n- Enter details of Student %d -&quot;, i + 1); + inputStudent(&amp;std[i]); + } + + printf(&quot;\n=== Student Details ===\n&quot;); + for (i = 0; i &lt; n; i++) + { + displayStudent(std[i]); + } + + free(std); + return 0; +} + +void inputStudent(struct Student *std) +{ + int len; + + printf(&quot;\nEnter the Roll Number: &quot;); + scanf(&quot;%d&quot;, &amp;std-&gt;rollNumber); + getchar(); + + printf(&quot;Enter the Name (Max: 50 character): &quot;); + fgets(std-&gt;name, sizeof(std-&gt;name), stdin); + len = strlen(std-&gt;name); + if (len &gt; 0 &amp;&amp; std-&gt;name[len - 1] == &#x27;\n&#x27;) + { + std-&gt;name[len - 1] = &#x27;\0&#x27;; + } + + printf(&quot;Enter the Marks: &quot;); + scanf(&quot;%f&quot;, &amp;std-&gt;marks); +} + +void displayStudent(struct Student std) +{ + printf(&quot;\n%-12s : %d&quot;, &quot;Roll Number&quot;, std.rollNumber); + printf(&quot;\n%-12s : %s&quot;, &quot;Name&quot;, std.name); + printf(&quot;\n%-12s : %g\n&quot;, &quot;Marks&quot;, std.marks); +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-12-c', 'assignment-p-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-12.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-12.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-12-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that takes multiple integers as command-line arguments and finds the +maximum and minimum value among them. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +// use atoi() + +int main(int argc, char *argv[]) +{ + int current_val, max_val, min_val, i; + char *endptr; + long first_arg_val; + if (argc &lt; 2) + { + printf(&quot;Usage: %s &lt;integer1&gt; &lt;integer2&gt; ...\n&quot;, argv[0]); + return 1; + } + first_arg_val = strtol(argv[1], &amp;endptr, 10); + if (*endptr != &#x27;\0&#x27; || argv[1] == endptr) + { + printf(&quot;Error: Argument &#x27;%s&#x27; is not a valid integer.\n&quot;, argv[1]); + return 1; + } + max_val = (int)first_arg_val; + min_val = (int)first_arg_val; + for (i = 2; i &lt; argc; i++) + { + long val = strtol(argv[i], &amp;endptr, 10); + if (*endptr != &#x27;\0&#x27; || argv[i] == endptr) + { + printf(&quot;Error: Argument &#x27;%s&#x27; is not a valid integer.\n&quot;, argv[i]); + return 1; + } + current_val = (int)val; + if (current_val &gt; max_val) + { + max_val = current_val; + } + if (current_val &lt; min_val) + { + min_val = current_val; + } + } + printf(&quot;The maximum value is: %d\n&quot;, max_val); + printf(&quot;The minimum value is: %d\n&quot;, min_val); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-13-c', 'assignment-p-13.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-13.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-13.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-13.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-13-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that accepts a string as a command line argument and includes a user- +defined function named isPalindrome with the signature int isPalindrome(char str[]);. +The function should check if the given string is a palindrome and return 1 if it is, and 0 +otherwise. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +int isPalindrome(char[]); + +int main(int argc, char *argv[]) +{ + if (argc != 2) + { + printf(&quot;\nUsage: %s &lt;string&gt;\n&quot;, argv[0]); + return 1; + } + if (isPalindrome(argv[1])) + { + printf(&quot;\nThe entered string \&quot;%s\&quot; is a Palindrome.\n&quot;, argv[1]); + } + else + { + printf(&quot;\nThe entered string \&quot;%s\&quot; is not Palindrome.\n&quot;, argv[1]); + } + return 0; +} + +int isPalindrome(char str[]) +{ + char *start = str; + char *end = str; + if (*end != &#x27;\0&#x27;) + { + while (*(end + 1) != &#x27;\0&#x27;) + { + end++; + } + } + else + { + return 1; + } + /* + Or we can use string.h instead of from line 33 to line 43 like this ... + + char *end; + int len = strlen(str); + if (len == 0) + { + return 1; + } + end = str + (len - 1); + + */ + while (start &lt; end) + { + if (*start != *end) + { + return 0; + } + start++; + end--; + } + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-14-c', 'assignment-p-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-14.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-14.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-14-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that opens its own source code file, reads its contents, and then prints +the contents to the console. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; +#include &lt;stdlib.h&gt; + +int main(int argc, char *argv[]) +{ + FILE *code; + int character, len_upto_dot; + char *FILENAME; + char *dot; + + FILENAME = strdup(argv[0]); + + if (FILENAME == NULL) + { + printf(&quot;\nMemory allocation failed.\n&quot;); + return 1; + } + + dot = strrchr(FILENAME, &#x27;.&#x27;); + + if (dot != NULL) + { + len_upto_dot = dot - FILENAME; + FILENAME[len_upto_dot] = &#x27;\0&#x27;; + } + + strcat(FILENAME, &quot;.c&quot;); + + code = fopen(FILENAME, &quot;r&quot;); + + if (code == NULL) + { + printf(&quot;\nCould not open the source file: %s&quot;, FILENAME); + printf(&quot;\nPlease ensure the source file is in the same directory as the executable.\n&quot;); + free(FILENAME); + return 1; + } + + printf(&quot;\nReading file: %s&quot;, FILENAME); + printf(&quot;\n========== %s ==========\n\n&quot;, FILENAME); + + while ((character = fgetc(code)) != EOF) + { + putchar(character); + } + + printf(&quot;\n\n========== End of %s ==========\n&quot;, FILENAME); + + fclose(code); + free(FILENAME); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-primary-assignment-p-15-c', 'assignment-p-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-15.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-p-15.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-primary/assignment-p-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-primary-assignment-p-15-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program that reads a sequence of integers from a file named &#x27;input.txt&#x27;. This +program should segregate the odd numbers from the even numbers and store the odd +numbers in a new file named &#x27;ODDFile.txt&#x27; while storing the even numbers in another file +named &#x27;EVENFile.txt&#x27; */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;string.h&gt; + +#define FILENAME &quot;input.txt&quot; +#define ODDFILE &quot;ODDFile.txt&quot; +#define EVENFILE &quot;EVENFile.txt&quot; + +int main() +{ + FILE *numbers = NULL; + FILE *oddfile = NULL; + FILE *evenfile = NULL; + int num; + numbers = fopen(FILENAME, &quot;r&quot;); + if (numbers == NULL) + { + printf(&quot;\nCould not open the file: %s&quot;, FILENAME); + return 1; + } + oddfile = fopen(ODDFILE, &quot;w&quot;); + if (oddfile == NULL) + { + printf(&quot;\nCould not open the file: %s&quot;, ODDFILE); + return 1; + } + evenfile = fopen(EVENFILE, &quot;w&quot;); + if (evenfile == NULL) + { + printf(&quot;\nCould not open the file: %s&quot;, EVENFILE); + return 1; + } + while (fscanf(numbers, &quot;%d&quot;, &amp;num) == 1) + { + if (num % 2 == 0) + { + fprintf(evenfile, &quot;%d &quot;, num); + } + else + { + fprintf(oddfile, &quot;%d &quot;, num); + } + } + printf(&quot;\nSuccessfully processed numbers from %s.\n&quot;, FILENAME); + printf(&quot;Odd numbers written to %s.\n&quot;, ODDFILE); + printf(&quot;Even numbers written to %s.\n&quot;, EVENFILE); + + fclose(numbers); + fclose(oddfile); + fclose(evenfile); + + return 0; +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">assignment-secondary</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-01-c', 'assignment-s-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-01.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-01.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-01-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to compute the sum and product of digits of an integer using user +defined functions. */ + +#include &lt;stdio.h&gt; + +int sum_of_digits(int); +int product_of_digits(int); + +int main() +{ + int num; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;num); + printf(&quot;\nSum of digits of %d = %d&quot;, num, sum_of_digits(num)); + printf(&quot;\nProduct of digits of %d = %d&quot;, num, product_of_digits(num)); + return 0; +} + +int sum_of_digits(int num) +{ + int sum = 0; + while (num &gt; 0) + { + sum += num % 10; + num /= 10; + } + return sum; +} + +int product_of_digits(int num) +{ + int product = 1; + while (num &gt; 0) + { + product *= num % 10; + num /= 10; + } + return product; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-02-c', 'assignment-s-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-02.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-02.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-02-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to reverse a non-negative integer using a function. */ + +#include &lt;stdio.h&gt; + +int reverse(int); + +int main() +{ + int num; + printf(&quot;Enter a non-negetive integer: &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (num &lt; 0) + { + printf(&quot;\nOnly non-negetive integers are allowed.&quot;); + return 1; + } + printf(&quot;\nReverse of the integer %d = %d&quot;, num, reverse(num)); + return 0; +} + +int reverse(int num) +{ + int rev = 0; + while (num &gt; 0) + { + rev = (rev * 10) + (num % 10); + num /= 10; + } + return rev; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-03-c', 'assignment-s-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-03.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-03.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-03-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to compute the sum of the first n terms of the series using a function: +S=1−2+3−4+5−6+… */ + +#include &lt;stdio.h&gt; + +int sum_of_series(int); + +int main() +{ + int n; + printf(&quot;Enter the n: &quot;); + scanf(&quot;%d&quot;, &amp;n); + printf(&quot;\nSum of the first %d terms of the series = %d&quot;, n, sum_of_series(n)); + return 0; +} + +int sum_of_series(int n) +{ + int sum = 0; + int i; + for (i = 1; i &lt;= n; i++) + { + if (i % 2 == 0) + { + sum -= i; + } + else + { + sum += i; + } + } + return sum; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-04-c', 'assignment-s-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-04.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-04.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-04-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function to check whether a number is prime or not. Use the same function to +generate all prime numbers less than 100. */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int isPrime(int); + +int main() +{ + int n, i; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (isPrime(n)) + { + printf(&quot;\nInput %d is a Prime Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is not a Prime Number.&quot;, n); + } + printf(&quot;\nPrime Numbers less than 100:&quot;); + for (i = 1; i &lt; 100; i++) + { + if (isPrime(i)) + { + printf(&quot; %d&quot;, i); + } + } + return 0; +} + +int isPrime(int n) +{ + if (n &lt;= 1) + return 0; + if (n == 2) + return 1; + if (n % 2 == 0) + return 0; + + int temp = (int)sqrt(n); + int i; + for (i = 3; i &lt;= temp; i += 2) + { + if (n % i == 0) + { + return 0; + } + } + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-05-c', 'assignment-s-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-05.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-05.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-05-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function to check whether a given string is a palindrome. Use this function to +determine whether an entered string is Palindrome. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +int isPalindrome(char[]); + +int main() +{ + char input[100]; + int len; + + printf(&quot;Enter the string (Max: 100 Character): &quot;); + fgets(input, sizeof(input), stdin); + len = strlen(input); + + if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) + { + input[len - 1] = &#x27;\0&#x27;; + } + + if (isPalindrome(input)) + { + printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); + } + else + { + printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); + } + + return 0; +} + +int isPalindrome(char str[]) +{ + char *start = str; + char *end; + int len = strlen(str); + + if (len == 0) + { + return 1; + } + + end = str + (len - 1); + + while (start &lt; end) + { + if (*start != *end) + { + return 0; + } + start++; + end--; + } + + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-06-c', 'assignment-s-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-06.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-06.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-06-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program using a function to compute and display all factors of a given number. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void display_factors(int); + +int main() +{ + int num, i; + printf(&quot;Please enter the number to get the factors from it : &quot;); + scanf(&quot;%d&quot;, &amp;num); + display_factors(num); + return 0; +} + +void display_factors(int num) { + int temp = abs(num); + int i; + + if (temp == 0) + { + printf(&quot;\n0 has infinitely many factors (all integers).&quot;); + exit(1); + } + + printf(&quot;\nThe factors of &#x27; %d &#x27; is :- &quot;, num); + printf(&quot;\nPositive : &quot;); + for (i = 1; i &lt;= temp; i++) + if (temp % i == 0) + printf(&quot; %d&quot;, i); + printf(&quot;\nNegative : &quot;); + for (i = 1; i &lt;= temp; i++) + if (temp % i == 0) + printf(&quot; %d&quot;, -i); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-07-c', 'assignment-s-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-07.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-07.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-07-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to swap two numbers using a macro (#define). */ + +// IMPOSSIBLE +/* It is impossible to swap two literal numbers defined using the +preprocessor directive #define. This is because #define performs simple +text substitution and does not create variables in memory that can be +manipulated or pointed to. */ + +// Using a Function-Like Macro + +#include &lt;stdio.h&gt; + +// Define the SWAP macro. +// The do-while(0) block is a common trick to ensure the macro behaves +// like a single statement, regardless of where it is used (e.g., inside an &#x27;if&#x27; statement). +#define SWAP(a, b, data_type) \ + do { \ + data_type temp = a; \ + a = b; \ + b = temp; \ + } while(0) + +int main() { + int num1 = 15; + int num2 = 42; + + printf(&quot;--- Before Swap ---\n&quot;); + printf(&quot;Number 1 (num1): %d\n&quot;, num1); + printf(&quot;Number 2 (num2): %d\n&quot;, num2); + + // Call the macro, passing the variables and their type + // The preprocessor replaces this line with the block of code defined above. + SWAP(num1, num2, int); + + printf(&quot;\n--- After Swap (using macro) ---\n&quot;); + printf(&quot;Number 1 (num1): %d\n&quot;, num1); + printf(&quot;Number 2 (num2): %d\n&quot;, num2); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-08-c', 'assignment-s-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-08.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-08.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-08-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program that counts the number of occurrences of each alphabet (A-Z, a-z) in +the text entered using Command-Line Arguments. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +int main(int argc, char *argv[]) +{ + int target[2], i, j, count[2], len; + for (target[0] = &#x27;A&#x27;, target[1] = &#x27;a&#x27;; target[0] &lt;= &#x27;Z&#x27;, target[1] &lt;= &#x27;z&#x27;; target[0]++, target[1]++) + { + count[0] = 0; + count[1] = 0; + for (i = 1; i &lt; argc; i++) + { + len = strlen(argv[i]); + for (j = 0; j &lt; len; j++) + { + if (argv[i][j] == target[0]) + { + count[0]++; + } + if (argv[i][j] == target[1]) + { + count[1]++; + } + } + } + if (count[0]) + { + printf(&quot;\n\&quot;%c\&quot; found %d times.&quot;, target[0], count[0]); + } + if (count[1]) + { + printf(&quot;\n\&quot;%c\&quot; found %d times.&quot;, target[1], count[1]); + } + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-09-c', 'assignment-s-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-09.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-09.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-09-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to swap two numbers using pointers (user-defined function). */ + +#include &lt;stdio.h&gt; + +void swap(int *, int *); + +int main() +{ + int a, b; + printf(&quot;Enter value for a and b: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + printf(&quot;\nBefore Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + swap(&amp;a, &amp;b); + printf(&quot;\nAfter Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + return 0; +} + +void swap(int *a, int *b) +{ + *a = *a ^ *b; + *b = *a ^ *b; + *a = *a ^ *b; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-10-c', 'assignment-s-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-10.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-10.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-10-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to swap two numbers using pointers (user-defined function). */ + +#include &lt;stdio.h&gt; + +void swap(int *, int *); + +int main() +{ + int a, b; + printf(&quot;Enter value for a and b: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + printf(&quot;\nBefore Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + swap(&amp;a, &amp;b); + printf(&quot;\nAfter Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + return 0; +} + +void swap(int *a, int *b) +{ + *a = *a ^ *b; + *b = *a ^ *b; + *a = *a ^ *b; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-11-c', 'assignment-s-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-11.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-11.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-11-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program that takes the radius of a circle as input, passes it to a function that +computes area and circumference, and displays results in main(). */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +void area_circumference(double, double *, double *); + +int main() +{ + double r, area, circumference; + printf(&quot;Enter the radius of the circle: &quot;); + scanf(&quot;%lf&quot;, &amp;r); + area_circumference(r, &amp;area, &amp;circumference); + printf(&quot;\nArea of the circle = %g&quot;, area); + printf(&quot;\nCircumference of the circle = %g&quot;, circumference); + return 0; +} + +void area_circumference(double r, double *area, double *circumference) +{ + *area = M_PI * r * r; + *circumference = 2 * M_PI * r; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-12-c', 'assignment-s-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-12.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-12.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-12-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the sum of n elements entered by the user. Use dynamic +memory allocation (malloc() or calloc()). */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputarr(int[], int); +int sum_elem(int[], int); + +int main() +{ + int n, *arr; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;n); + arr = (int *)malloc(n * sizeof(int)); + inputarr(arr, n); + printf(&quot;\nSum of the %d element(s) = %d&quot;, n, sum_elem(arr, n)); + free(arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int sum_elem(int arr[], int n) +{ + int i, sum = 0; + for (i = 0; i &lt; n; i++) + { + sum += arr[i]; + } + return sum; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-13-1-c', 'assignment-s-13-1.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-1.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-13-1.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-1.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-13-1-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 19 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function that reverses the elements of an array in place, using only a single +pointer argument, and return void. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputarr(int[], int); +void display(int[], int); +void reverse(int *); + +int main() +{ + int size, *arr; + printf(&quot;How many element do you want to add: &quot;); + scanf(&quot;%d&quot;, &amp;size); + arr = (int *)malloc((size + 1) * sizeof(int)); + inputarr(arr, size); + printf(&quot;\n=== Before Reverse ===\n&quot;); + display(arr, size); + reverse(arr); + printf(&quot;\n\n=== After Reverse ===\n&quot;); + display(arr, size); + free(arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + arr[0] = n; + for (i = 1; i &lt;= n; i++) + { + printf(&quot;Enter element %d: &quot;, i); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +void display(int arr[], int n) +{ + int i; + for (i = 1; i &lt;= n; i++) + { + printf(&quot;\nIndex: %-2d | Value: %-5d | Address: %p&quot;, i, arr[i], (void *)&amp;arr[i]); + } +} + +void reverse(int *arr) +{ + int *start = arr + 1; + int size = *arr; + int *end = arr + size; + while (start &lt; end) + { + *start = *start ^ *end; + *end = *start ^ *end; + *start = *start ^ *end; + start++; + end--; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-13-2-c', 'assignment-s-13-2.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-2.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-13-2.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-13-2.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-13-2-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 19 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function that reverses the elements of an array in place, using only a single +pointer argument, and return void. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +struct Array +{ + int size; + int *arr; +}; + +void inputarr(int[], int); +void display(int[], int); +void reverse(struct Array *); + +int main() +{ + struct Array array; + printf(&quot;How many element do you want to add: &quot;); + scanf(&quot;%d&quot;, &amp;array.size); + array.arr = (int *)malloc((array.size) * sizeof(int)); + inputarr(array.arr, array.size); + printf(&quot;\n=== Before Reverse ===\n&quot;); + display(array.arr, array.size); + reverse(&amp;array); + printf(&quot;\n\n=== After Reverse ===\n&quot;); + display(array.arr, array.size); + free(array.arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +void display(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;\nIndex: %-2d | Value: %-5d | Address: %p&quot;, i, arr[i], (void *)&amp;arr[i]); + } +} + +void reverse(struct Array *array) +{ + int *start = array-&gt;arr; + int *end = array-&gt;arr + (array-&gt;size - 1); + while (start &lt; end) + { + *start = *start ^ *end; + *end = *start ^ *end; + *start = *start ^ *end; + start++; + end--; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-14-c', 'assignment-s-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-14.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-14.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-14-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 20 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* + Write a menu-driven program to perform the following string operations: + a. Show address of each character + b. Concatenate two strings without using strcat() + c. Concatenate two strings using strcat() + d. Compare two strings + e. Find string length using pointers + f. Convert lowercase to uppercase + g. Convert uppercase to lowercase + h. Count number of vowels + i. Reverse the string +*/ + +#include &lt;stdio.h&gt; +#include &lt;ctype.h&gt; +#include &lt;string.h&gt; + +void address_char(char *); +void concat_manual(char[], char[]); +void concat_strcat(char[], char[]); +int string_cmp(char *, char *); +int string_len(char *); +void ltou(char[]); +void utol(char[]); +int vowel_count(char[]); +void reverse(char[]); + +int main() +{ + char str1[100], str2[100], choice; + int result_cmp; + + printf(&quot;Enter first string (Max: 100 character): &quot;); + fgets(str1, sizeof(str1), stdin); + str1[strcspn(str1, &quot;\n&quot;)] = &#x27;\0&#x27;; + // this will replace the enter (\n) used in the end to null + + printf(&quot;Enter second string (Max: 100 character): &quot;); + fgets(str2, sizeof(str2), stdin); + str2[strcspn(str2, &quot;\n&quot;)] = &#x27;\0&#x27;; + + while (1) + { + printf(&quot;\n\n\n ========== MENU ==========\n&quot; + &quot;a. Show address of each character\n&quot; + &quot;b. Concatenate two strings without using strcat()\n&quot; + &quot;c. Concatenate two strings using strcat()\n&quot; + &quot;d. Compare two strings\n&quot; + &quot;e. Find string length using pointers\n&quot; + &quot;f. Convert lowercase to uppercase\n&quot; + &quot;g. Convert uppercase to lowercase\n&quot; + &quot;h. Count number of vowels\n&quot; + &quot;i. Reverse the string\n&quot; + &quot;1. Change input strings\n&quot; + &quot;0. Exit\n&quot;); + printf(&quot;\nEnter your choice: &quot;); + scanf(&quot; %c&quot;, &amp;choice); + choice = tolower(choice); + + switch (choice) + { + case &#x27;1&#x27;: + while (getchar() != &#x27;\n&#x27;) + ; + printf(&quot;Enter first string (Max: 100 character): &quot;); + fgets(str1, sizeof(str1), stdin); + str1[strcspn(str1, &quot;\n&quot;)] = &#x27;\0&#x27;; + + printf(&quot;Enter second string (Max: 100 character): &quot;); + fgets(str2, sizeof(str2), stdin); + str2[strcspn(str2, &quot;\n&quot;)] = &#x27;\0&#x27;; + + break; + case &#x27;0&#x27;: + printf(&quot;\n\n\nExiting program...\n\n&quot;); + return 0; + + case &#x27;a&#x27;: + printf(&quot;\n --- Show address of each character ---\n&quot;); + printf(&quot;\nSrting 1: &quot;); + address_char(str1); + printf(&quot;\nString 2: &quot;); + address_char(str2); + break; + case &#x27;b&#x27;: + printf(&quot;\n --- Concatenate two strings without using strcat() ---\n&quot;); + printf(&quot;\nResult: &quot;); + concat_manual(str1, str2); + break; + case &#x27;c&#x27;: + printf(&quot;\n --- Concatenate two strings using strcat() ---\n&quot;); + printf(&quot;\nResult: &quot;); + concat_strcat(str1, str2); + break; + case &#x27;d&#x27;: + printf(&quot;\n --- Compare two strings ---\n&quot;); + result_cmp = string_cmp(str1, str2); + if (result_cmp == 0) + { + printf(&quot;\nString 1 = String 2&quot;); + break; + } + else if (result_cmp &gt; 0) + { + printf(&quot;\nString 1 &gt; String 2&quot;); + break; + } + else + { + printf(&quot;\nString 1 &lt; String 2&quot;); + break; + } + case &#x27;e&#x27;: + printf(&quot;\n --- Find string length using pointers ---\n&quot;); + printf(&quot;\nLength of the String_1: %d&quot;, string_len(str1)); + printf(&quot;\nLength of the String_2: %d&quot;, string_len(str2)); + break; + case &#x27;f&#x27;: + printf(&quot;\n --- Convert lowercase to uppercase ---\n&quot;); + printf(&quot;\nString 1: &quot;); + ltou(str1); + printf(&quot;\nString 2: &quot;); + ltou(str2); + break; + case &#x27;g&#x27;: + printf(&quot;\n --- Convert uppercase to lowercase ---\n&quot;); + printf(&quot;\nString 1: &quot;); + utol(str1); + printf(&quot;\nString 2: &quot;); + utol(str2); + break; + case &#x27;h&#x27;: + printf(&quot;\n --- Count number of vowels ---\n&quot;); + printf(&quot;\nString 1: %d&quot;, vowel_count(str1)); + printf(&quot;\nString 2: %d&quot;, vowel_count(str2)); + break; + case &#x27;i&#x27;: + printf(&quot;\n --- Reverse the string ---\n&quot;); + printf(&quot;\nString 1: &quot;); + reverse(str1); + printf(&quot;\nString 2: &quot;); + reverse(str2); + break; + default: + printf(&quot;\nWrong choice. Try again...\n&quot;); + } + } +} + +void address_char(char *str) +{ + printf(&quot;\nCharacter | Memory Address&quot;); + printf(&quot;\n--------- | --------------&quot;); + + while (*str != &#x27;\0&#x27;) + { + printf(&quot;\n %-6c| %p&quot;, *str, (void *)str); + str++; + } +} + +void concat_manual(char str1[], char str2[]) +{ + int size1 = strlen(str1); + int size2 = strlen(str2); + char result[size1 + size2 + 1]; + int i = 0, j; + + j = 0; + while (str1[j] != &#x27;\0&#x27;) + { + result[i] = str1[j]; + i++; + j++; + } + + j = 0; + while (str2[j] != &#x27;\0&#x27;) + { + result[i] = str2[j]; + i++; + j++; + } + + result[i] = &#x27;\0&#x27;; + printf(&quot;%s\n&quot;, result); +} + +void concat_strcat(char str1[], char str2[]) +{ + int size1 = strlen(str1); + int size2 = strlen(str2); + char result[size1 + size2 + 1]; + + result[0] = &#x27;\0&#x27;; + strcat(result, str1); + strcat(result, str2); + + printf(&quot;%s\n&quot;, result); +} + +int string_cmp(char *str1, char *str2) +{ + // written based on strcmp() + while (*str1 != &#x27;\0&#x27; &amp;&amp; (*str1 == *str2)) + { + str1++; + str2++; + } + return (*str1 - *str2); +} + +int string_len(char *str) +{ + char *end = str; + while (*end != &#x27;\0&#x27;) + { + end++; + } + return end - str; +} + +void ltou(char str[]) +{ + int i; + for (i = 0; str[i] != &#x27;\0&#x27;; i++) + { + printf(&quot;%c&quot;, toupper(str[i])); + } +} + +void utol(char str[]) +{ + int i; + for (i = 0; str[i] != &#x27;\0&#x27;; i++) + { + printf(&quot;%c&quot;, tolower(str[i])); + } +} + +int vowel_count(char str[]) +{ + int i, vowel = 0; + char character; + for (i = 0; str[i] != &#x27;\0&#x27;; i++) + { + character = tolower(str[i]); + if (character == &#x27;a&#x27; || character == &#x27;e&#x27; || character == &#x27;i&#x27; || character == &#x27;o&#x27; || character == &#x27;u&#x27;) + { + vowel++; + } + } + return vowel; +} + +void reverse(char str[]) +{ + int len = strlen(str); + char result[len + 1]; + char *start = result; + char *end = result + len - 1; + char temp; + + result[0] = &#x27;\0&#x27;; + strcat(result, str); + + while (start &lt; end) + { + temp = *start; + *start = *end; + *end = temp; + start++; + end--; + } + printf(&quot;%s\n&quot;, result); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-15-c', 'assignment-s-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-15.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-15.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-15-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to merge two sorted integer arrays to form a single sorted array. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void merge(int[], int, int[], int); + +int main() +{ + int a[] = {10, 30, 50, 70, 90}; + int b[] = {20, 40, 60, 80, 100}; + int n1 = sizeof(a) / sizeof(a[0]); + int n2 = sizeof(b) / sizeof(b[0]); + merge(a, n1, b, n2); + return 0; +} + +void merge(int a[], int n1, int b[], int n2) +{ + int n = n1 + n2; + int *c = (int *)malloc(n * sizeof(int)); + int i, j, k; + i = j = k = 0; + while (i &lt; n1 &amp;&amp; j &lt; n2) + { + if (a[i] &lt; b[j]) + { + c[k++] = a[i++]; + } + else + { + c[k++] = b[j++]; + } + } + while (i &lt; n1) + { + c[k++] = a[i++]; + } + while (j &lt; n2) + { + c[k++] = b[j++]; + } + printf(&quot;Merged Array:&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %d&quot;, c[i]); + } + free(c); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-16-c', 'assignment-s-16.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-16.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-16.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-16.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-16-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program that reads 10 integers into an array (using pointers), and prints the +array in ascending and descending order. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +#define true 1 +#define false 0 + +void input_arr(int *, int); +void print(int *, int); + +int main() +{ + int arr[10]; + input_arr(arr, 10); + print(arr, 10); + return 0; +} + +void input_arr(int *arr, int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, arr + i); + } +} + +void print(int *arr, int n) +{ + int i, j, isSwaped = true, backup; + int *temp = (int *)malloc(n * sizeof(int)); + if (temp == NULL) + { + printf(&quot;\nMemory Allocation Failed.&quot;); + return; + } + for (i = 0; i &lt; n; i++) + { + *(temp + i) = *(arr + i); + } + for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) + { + isSwaped = false; + for (j = 0; j &lt; n - i - 1; j++) + { + if (*(temp + j) &gt; *(temp + j + 1)) + { + backup = *(temp + j); + *(temp + j) = *(temp + j + 1); + *(temp + j + 1) = backup; + isSwaped = true; + } + } + } + printf(&quot;\nAscending Order:&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %d&quot;, *(temp + i)); + } + printf(&quot;\nDescending Order:&quot;); + for (i = n - 1; i &gt;= 0; i--) + { + printf(&quot; %d&quot;, *(temp + i)); + } + free(temp); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-17-c', 'assignment-s-17.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-17.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-17.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-17.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-17-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to display the Fibonacci series + (i) using recursion + (ii) using iteration +*/ + +#include &lt;stdio.h&gt; + +long long int fib_rec(int); +long long int fib_tail_rec(int, long long int, long long int); +void fib_rec_print(int); +void fib_ite_print(int); + +int main() +{ + int n; + printf(&quot;Enter the number of terms: &quot;); + scanf(&quot;%d&quot;, &amp;n); + fib_rec_print(n); + fib_ite_print(n); + return 0; +} + +long long int fib_rec(int n) +{ + if (n == 0 || n == 1) + { + return n; + } + else + { + return fib_rec(n - 1) + fib_rec(n - 2); + } +} + +long long int fib_tail_rec(int n, long long int t1, long long int t2) +{ + if (n == 0) + { + return t1; + } + else if (n == 1) + { + return t2; + } + else + { + return fib_tail_rec(n - 1, t2, t1 + t2); + } +} + +void fib_rec_print(int n) +{ + int i; + printf(&quot;\nFibonacci Series (Recursion):&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %lld&quot;, fib_rec(i)); + } + printf(&quot;\nFibonacci Series (Tail-Recursion):&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %lld&quot;, fib_tail_rec(i, 0, 1)); + } +} + +void fib_ite_print(int n) +{ + int i; + long long int t1 = 0, t2 = 1, temp; + printf(&quot;\nFibonacci Series (Iteration):&quot;); + if (n &gt; 0) + { + printf(&quot; 0&quot;); + } + if (n &gt; 1) + { + printf(&quot; 1&quot;); + } + for (i = 2; i &lt; n; i++) + { + printf(&quot; %lld&quot;, t1 + t2); + temp = t1; + t1 = t2; + t2 = temp + t2; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-18-c', 'assignment-s-18.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-18.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-18.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-18.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-18-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to calculate the factorial of a number + (i) using recursion + (ii) using iteration +*/ + +#include &lt;stdio.h&gt; + +long long int fact_tail_rec(int, long long int); +long long int fact_rec(int); +long long int fact_ite(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (n &lt; 0) + { + printf(&quot;\nFactorial of negetive number is not possible.&quot;); + return 1; + } + printf(&quot;\nFactorial of %d (Tail-Recursion) = %lld&quot;, n, fact_tail_rec(n, 1)); + printf(&quot;\nFactorial of %d (Recursion) = %lld&quot;, n, fact_rec(n)); + printf(&quot;\nFactorial of %d (Iteration) = %lld&quot;, n, fact_ite(n)); + return 0; +} + +long long int fact_tail_rec(int n, long long int result) +{ + if (n == 0 || n == 1) + { + return result; + } + else + { + return fact_tail_rec(n - 1, n * result); + } +} + +long long int fact_rec(int n) +{ + if (n == 0 || n == 1) + { + return 1; + } + else + { + return n * fact_rec(n - 1); + } +} + +long long int fact_ite(int n) +{ + int i; + long long int result = 1; + if (n == 0 || n == 1) + { + return 1; + } + for (i = 2; i &lt;= n; i++) + { + result *= i; + } + return result; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-19-c', 'assignment-s-19.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-19.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-19.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-19.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-19-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to calculate the GCD of two numbers + (i) using recursion + (ii) without recursion +*/ + +#include &lt;stdio.h&gt; + +int gcd_tail_rec(int, int); +int gcd_rec(int, int); +int gcd_ite(int, int); + +int main() +{ + int a, b; + printf(&quot;Enter two number: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + if (a &lt; 0) + a = -a; + if (b &lt; 0) + b = -b; + printf(&quot;\nGCD (Tail-Recursion) of %d and %d is = %d&quot;, a, b, gcd_tail_rec(a, b)); + printf(&quot;\nGCD (Recursion) of %d and %d is = %d&quot;, a, b, gcd_rec(a, b)); + printf(&quot;\nGCD (Iteration) of %d and %d is = %d&quot;, a, b, gcd_ite(a, b)); + return 0; +} + +int gcd_tail_rec(int a, int b) +{ + if (b == 0) + { + return a; + } + else + { + return gcd_tail_rec(b, a % b); + } +} + +int gcd_rec(int a, int b) +{ + if (b == 0) + { + return a; + } + else + { + return gcd_rec(b, a % b); + } +} + +int gcd_ite(int a, int b) +{ + int temp; + while (b &gt; 0) + { + temp = b; + b = a % b; + a = temp; + } + return a; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-20-c', 'assignment-s-20.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-20.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-20.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-20.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-20-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 22 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a menu-driven program to perform the following matrix operations using 2-D + arrays and functions: + a. Sum + b. Difference + c. Product + d. Transpose +*/ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +#define COL_MAX 10 +#define COL_MIN 0 +#define ROW_MAX 10 +#define ROW_MIN 0 +#define TRUE 1 +#define FALSE 0 + +void input(int ***, int *, int *); +void display(int **, int, int); +void clear(int **, int); +void sum(int **, int **, int, int); +void difference(int **, int **, int, int); +void product(int **, int **, int, int, int); +void transpose(int **, int, int); + +int main() +{ + int **a = NULL, **b = NULL; + int rows_a, rows_b, cols_a, cols_b; + int choice; + + while (TRUE) + { + printf(&quot;\n === MENU ===\n&quot; + &quot;1. Sum\n&quot; + &quot;2. Difference\n&quot; + &quot;3. Product\n&quot; + &quot;4. Transpose\n&quot; + &quot;0. Exit\n&quot;); + printf(&quot;\nEnter your choice: &quot;); + scanf(&quot;%d&quot;, &amp;choice); + + switch (choice) + { + case 1: + input(&amp;a, &amp;rows_a, &amp;cols_a); + if (a == NULL) + break; + + input(&amp;b, &amp;rows_b, &amp;cols_b); + if (b == NULL) + { + clear(a, rows_a); + a = NULL; + break; + } + + printf(&quot;\nMatrix A = \n&quot;); + display(a, rows_a, cols_a); + printf(&quot;\nMatrix B = \n&quot;); + display(b, rows_b, cols_b); + + if (rows_a != rows_b || cols_a != cols_b) + { + printf(&quot;\nOrder of both matrix should be same to calculate sum.&quot;); + printf(&quot;\nInput : Matrix A = [%d x %d]&quot; + &quot; Matrix B = [%d x %d]&quot;, + rows_a, cols_a, rows_b, cols_b); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + break; + } + printf(&quot;\nResult = \n&quot;); + sum(a, b, rows_a, cols_a); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + + break; + + case 2: + input(&amp;a, &amp;rows_a, &amp;cols_a); + if (a == NULL) + break; + + input(&amp;b, &amp;rows_b, &amp;cols_b); + if (b == NULL) + { + clear(a, rows_a); + a = NULL; + break; + } + + printf(&quot;\nMatrix A = \n&quot;); + display(a, rows_a, cols_a); + printf(&quot;\nMatrix B = \n&quot;); + display(b, rows_b, cols_b); + + if (rows_a != rows_b || cols_a != cols_b) + { + printf(&quot;\nOrder of both matrix should be same to calculate difference.&quot;); + printf(&quot;\nInput : Matrix A = [%d x %d]&quot; + &quot; Matrix B = [%d x %d]&quot;, + rows_a, cols_a, rows_b, cols_b); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + break; + } + printf(&quot;\nResult = \n&quot;); + difference(a, b, rows_a, cols_a); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + + break; + + case 3: + input(&amp;a, &amp;rows_a, &amp;cols_a); + if (a == NULL) + break; + + input(&amp;b, &amp;rows_b, &amp;cols_b); + if (b == NULL) + { + clear(a, rows_a); + a = NULL; + break; + } + + printf(&quot;\nMatrix A = \n&quot;); + display(a, rows_a, cols_a); + printf(&quot;\nMatrix B = \n&quot;); + display(b, rows_b, cols_b); + + if (cols_a != rows_b) + { + printf(&quot;\nColumn count of matrix A should be same as Row count of matrix B.&quot;); + printf(&quot;\nInput : Matrix A = [%d x %d]&quot; + &quot; Matrix B = [%d x %d]&quot;, + rows_a, cols_a, rows_b, cols_b); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + break; + } + printf(&quot;\nResult = \n&quot;); + product(a, b, rows_a, cols_b, cols_a); + + clear(a, rows_a); + clear(b, rows_b); + a = NULL; + b = NULL; + + break; + + case 4: + input(&amp;a, &amp;rows_a, &amp;cols_a); + if (a == NULL) + break; + + printf(&quot;\nMatrix = \n&quot;); + display(a, rows_a, cols_a); + + printf(&quot;\nResult = \n&quot;); + transpose(a, rows_a, cols_a); + + clear(a, rows_a); + a = NULL; + + break; + + case 0: + printf(&quot;\n\nExiting program...\n&quot;); + return 0; + + default: + printf(&quot;\nInvalid choice. Please pick a choice from the menu.\n&quot;); + } + } +} + +void input(int ***matrix, int *rows, int *cols) +{ + int i, j; + printf(&quot;\nEnter row and column count (Max : 10 x 10): &quot;); + scanf(&quot;%d %d&quot;, rows, cols); + + if (*rows &gt; ROW_MAX || *cols &gt; COL_MAX || *rows &lt;= ROW_MIN || *cols &lt;= COL_MIN) + { + printf(&quot;\nInvalid dimensions. Limit is 1 to 10.\n&quot;); + *matrix = NULL; + return; + } + + *matrix = (int **)malloc(*rows * sizeof(int *)); + + for (i = 0; i &lt; *rows; i++) + { + (*matrix)[i] = (int *)malloc(*cols * sizeof(int)); + for (j = 0; j &lt; *cols; j++) + { + printf(&quot;Enter element [%d][%d]: &quot;, i + 1, j + 1); + scanf(&quot;%d&quot;, &amp;((*matrix)[i][j])); + } + } +} + +void display(int **matrix, int rows, int cols) +{ + int i, j; + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + { + printf(&quot;%d &quot;, matrix[i][j]); + } + printf(&quot;\n&quot;); + } +} + +void clear(int **matrix, int rows) +{ + int i; + for (i = 0; i &lt; rows; i++) + { + free(matrix[i]); + } + free(matrix); +} + +void sum(int **a, int **b, int rows, int cols) +{ + int i, j; + + int **r = (int **)malloc(rows * sizeof(int *)); + for (i = 0; i &lt; rows; i++) + { + r[i] = (int *)malloc(cols * sizeof(int)); + for (j = 0; j &lt; cols; j++) + { + r[i][j] = a[i][j] + b[i][j]; + } + } + display(r, rows, cols); + clear(r, rows); +} + +void difference(int **a, int **b, int rows, int cols) +{ + int i, j; + + int **r = (int **)malloc(rows * sizeof(int *)); + for (i = 0; i &lt; rows; i++) + { + r[i] = (int *)malloc(cols * sizeof(int)); + for (j = 0; j &lt; cols; j++) + { + r[i][j] = a[i][j] - b[i][j]; + } + } + display(r, rows, cols); + clear(r, rows); +} + +void product(int **a, int **b, int rows_a, int cols_b, int common) +{ + int i, x, y, z, temp; + + int **r = (int **)malloc(rows_a * sizeof(int *)); + for (i = 0; i &lt; rows_a; i++) + { + r[i] = (int *)malloc(cols_b * sizeof(int)); + } + + for (x = 0; x &lt; rows_a; x++) + { + for (y = 0; y &lt; cols_b; y++) + { + temp = 0; + for (z = 0; z &lt; common; z++) + { + temp += a[x][z] * b[z][y]; + } + r[x][y] = temp; + } + } + display(r, rows_a, cols_b); + clear(r, rows_a); +} + +void transpose(int **matrix, int rows, int cols) +{ + int i, j; + + int **r = (int **)malloc(cols * sizeof(int *)); + for (i = 0; i &lt; cols; i++) + { + r[i] = (int *)malloc(rows * sizeof(int)); + for (j = 0; j &lt; rows; j++) + { + r[i][j] = matrix[j][i]; + } + } + display(r, cols, rows); + clear(r, cols); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-21-c', 'assignment-s-21.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-21.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-21.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-21.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-21-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 21 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to copy the contents of a text file to another file, after removing all +white spaces (spaces, tabs, newlines). */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;string.h&gt; + +#define NEW_FILE_PREFIX &quot;cleaned_&quot; + +int cleaning(FILE *); + +int main() +{ + char filename[50]; + char *newFilename = NULL; + FILE *givenFile = NULL; + FILE *cleanedFile = NULL; + int len, temp; + + printf(&quot;Enter the filename (Max: 50 character): &quot;); + fgets(filename, sizeof(filename), stdin); + len = strlen(filename); + if (filename[len - 1] == &#x27;\n&#x27;) + { + filename[len - 1] = &#x27;\0&#x27;; + } + + givenFile = fopen(filename, &quot;r&quot;); + if (givenFile == NULL) + { + printf(&quot;\nCouldn&#x27;t opened the file \&quot;%s\&quot;&quot; + &quot;\nPlease ensure that \&quot;%s\&quot; is in the same folder.&quot;, + filename, filename); + return 1; + } + + len += strlen(NEW_FILE_PREFIX); + newFilename = (char *)malloc((len + 1) * sizeof(char)); + if (newFilename == NULL) + { + printf(&quot;\nMemory allocation failed.&quot;); + fclose(givenFile); + return 1; + } + newFilename[0] = &#x27;\0&#x27;; + strcat(newFilename, NEW_FILE_PREFIX); + strcat(newFilename, filename); + + cleanedFile = fopen(newFilename, &quot;w&quot;); + if (cleanedFile == NULL) + { + printf(&quot;\nCUnable to create the file \&quot;%s\&quot;&quot;, newFilename); + free(newFilename); + return 1; + } + + while ((temp = fgetc(givenFile)) != EOF) + { + if (temp != &#x27; &#x27; &amp;&amp; temp != &#x27;\n&#x27; &amp;&amp; temp != &#x27;\t&#x27;) + { + fputc(temp, cleanedFile); + } + } + + printf(&quot;\nSuccessfully cleaned: \&quot;%s\&quot;&quot;, filename); + printf(&quot;\nGenerated file: \&quot;%s\&quot;&quot;, newFilename); + + fclose(givenFile); + fclose(cleanedFile); + free(newFilename); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-22-c', 'assignment-s-22.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-22.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-22-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program using structures to add two distances in meter-kilometer format. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +struct distance +{ + int km; + int m; +}; + +void total_distance(struct distance[]); + +int main() +{ + struct distance dis[2] = {0}; + printf(&quot;Enter the 1st distance (KM M): &quot;); + scanf(&quot;%d %d&quot;, &amp;dis[0].km, &amp;dis[0].m); + printf(&quot;Enter the 2nd distance: &quot;); + scanf(&quot;%d %d&quot;, &amp;dis[1].km, &amp;dis[1].m); + total_distance(dis); + return 0; +} + +void total_distance(struct distance dis[]) +{ + int result_km = dis[0].km + dis[1].km; + int result_m = dis[0].m + dis[1].m; + result_km += result_m / 1000; + result_m = result_m % 1000; + printf(&quot;Total distance: %d KM, %d M&quot;, result_km, result_m); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-23-c', 'assignment-s-23.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-23.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-23-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to add two complex numbers using structures. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +struct complex_number +{ + double real; + double imaginary; +}; + +int main() +{ + struct complex_number a, b; + printf(&quot;Enter the 1st complex number in this format (a+bi): &quot;); + scanf(&quot;%lf+%lfi&quot;, &amp;a.real, &amp;a.imaginary); + printf(&quot;Enter the 2nd complex number in this format (a+bi): &quot;); + scanf(&quot;%lf+%lfi&quot;, &amp;b.real, &amp;b.imaginary); + + printf(&quot;Result = %-2g + %-2.2g&quot;, a.real + b.real, a.imaginary + b.imaginary); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-24-c', 'assignment-s-24.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-24.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-assignment-secondary-assignment-s-24-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 18 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to calculate the difference between two time periods using structures. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +struct time_dif +{ + int hour; + int min; + int sec; +}; + +int main() +{ + struct time_dif tpA, tpB; + long int tfA, tfB, tdif; + printf(&quot;Enter the start time in this 24 hours clock format (HH MM SS): &quot;); + scanf(&quot;%d %d %d&quot;, &amp;tpA.hour, &amp;tpA.min, &amp;tpA.sec); + printf(&quot;Enter the end time in this 24 hours clock format (HH MM SS): &quot;); + scanf(&quot;%d %d %d&quot;, &amp;tpB.hour, &amp;tpB.min, &amp;tpB.sec); + + tfA = tpA.hour * 3600 + tpA.min * 60 + tpA.sec; + tfB = tpB.hour * 3600 + tpB.min * 60 + tpB.sec; + tdif = tfB - tfA; + if (tdif &lt; 0) + { + printf(&quot;\nWrong information, End time should be later than Start time.&quot;); + return 1; + } + printf(&quot;\nTime difference: %ld Hour(s) %ld Minutes(s) %ld Second(s).&quot;, tdif / 3600, (tdif % 3600) / 60, (tdif % 3600) % 60); + + return 0; +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">challenge</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-maheswar01-c', 'maheswar01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/maheswar01.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">maheswar01.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/maheswar01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-challenge-maheswar01-c" style="display:none;">#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;ctype.h&gt; +#include &lt;string.h&gt; + +#define MAX 1000 + +/* ================= STACK FOR OPERATORS ================= */ + +typedef struct { + char data[MAX]; + int top; +} CharStack; + +void initCharStack(CharStack *s) { + s-&gt;top = -1; +} + +void pushChar(CharStack *s, char c) { + s-&gt;data[++s-&gt;top] = c; +} + +char popChar(CharStack *s) { + return s-&gt;data[s-&gt;top--]; +} + +char peekChar(CharStack *s) { + return s-&gt;data[s-&gt;top]; +} + +int isEmptyChar(CharStack *s) { + return s-&gt;top == -1; +} + +/* ================= STACK FOR NUMBERS ================= */ + +typedef struct { + double data[MAX]; + int top; +} DoubleStack; + +void initDoubleStack(DoubleStack *s) { + s-&gt;top = -1; +} + +void pushDouble(DoubleStack *s, double x) { + s-&gt;data[++s-&gt;top] = x; +} + +double popDouble(DoubleStack *s) { + return s-&gt;data[s-&gt;top--]; +} + +/* ================= HELPER FUNCTIONS ================= */ + +int precedence(char op) { + if (op == &#x27;+&#x27; || op == &#x27;-&#x27;) return 1; + if (op == &#x27;*&#x27; || op == &#x27;/&#x27;) return 2; + return 0; +} + +int isOperator(char c) { + return c == &#x27;+&#x27; || c == &#x27;-&#x27; || c == &#x27;*&#x27; || c == &#x27;/&#x27;; +} + +/* ================= INFIX TO POSTFIX ================= */ + +void infixToPostfix(const char *infix, char *postfix) { + CharStack stack; + initCharStack(&amp;stack); + + int i = 0, k = 0; + + while (infix[i]) { + if (isspace(infix[i])) { + i++; + continue; + } + + if (isdigit(infix[i]) || infix[i] == &#x27;.&#x27;) { + while (isdigit(infix[i]) || infix[i] == &#x27;.&#x27;) { + postfix[k++] = infix[i++]; + } + postfix[k++] = &#x27; &#x27;; + } + else if (infix[i] == &#x27;(&#x27;) { + pushChar(&amp;stack, infix[i]); + i++; + } + else if (infix[i] == &#x27;)&#x27;) { + while (!isEmptyChar(&amp;stack) &amp;&amp; peekChar(&amp;stack) != &#x27;(&#x27;) { + postfix[k++] = popChar(&amp;stack); + postfix[k++] = &#x27; &#x27;; + } + popChar(&amp;stack); // remove &#x27;(&#x27; + i++; + } + else if (isOperator(infix[i])) { + while (!isEmptyChar(&amp;stack) &amp;&amp; + precedence(peekChar(&amp;stack)) &gt;= precedence(infix[i])) { + postfix[k++] = popChar(&amp;stack); + postfix[k++] = &#x27; &#x27;; + } + pushChar(&amp;stack, infix[i]); + i++; + } + else { + printf(&quot;Invalid character: %c\n&quot;, infix[i]); + exit(1); + } + } + + while (!isEmptyChar(&amp;stack)) { + postfix[k++] = popChar(&amp;stack); + postfix[k++] = &#x27; &#x27;; + } + + postfix[k] = &#x27;\0&#x27;; +} + +/* ================= POSTFIX EVALUATION ================= */ + +double evaluatePostfix(const char *postfix) { + DoubleStack stack; + initDoubleStack(&amp;stack); + + int i = 0; + + while (postfix[i]) { + if (isspace(postfix[i])) { + i++; + continue; + } + + if (isdigit(postfix[i]) || postfix[i] == &#x27;.&#x27;) { + char number[50]; + int k = 0; + + while (isdigit(postfix[i]) || postfix[i] == &#x27;.&#x27;) { + number[k++] = postfix[i++]; + } + number[k] = &#x27;\0&#x27;; + + pushDouble(&amp;stack, atof(number)); + } + else if (isOperator(postfix[i])) { + double b = popDouble(&amp;stack); + double a = popDouble(&amp;stack); + + switch (postfix[i]) { + case &#x27;+&#x27;: pushDouble(&amp;stack, a + b); break; + case &#x27;-&#x27;: pushDouble(&amp;stack, a - b); break; + case &#x27;*&#x27;: pushDouble(&amp;stack, a * b); break; + case &#x27;/&#x27;: + if (b == 0) { + printf(&quot;Error: Division by zero\n&quot;); + exit(1); + } + pushDouble(&amp;stack, a / b); + break; + } + i++; + } + } + + return popDouble(&amp;stack); +} + +/* ================= MAIN ================= */ + +int main() { + char infix[MAX]; + char postfix[MAX]; + + printf(&quot;Enter expression: &quot;); + fgets(infix, MAX, stdin); + + infixToPostfix(infix, postfix); + + double result = evaluatePostfix(postfix); + + printf(&quot;Result = %.10g\n&quot;, result); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-sudipto1-c', 'sudipto1.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudipto1.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">sudipto1.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudipto1.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-challenge-sudipto1-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* A smart home security controller monitors the state of several sensors to decide what action to take. + * Each second, the system reads data from sensors that can either be active or inactive. Based on the current + * state of all sensors, the controller must perform exactly one action, such as activating a warning, checking + * a specific zone, or declaring an intrusion. Write a C program that reads the sensor states as input and + * prints the corresponding system action. + -- Conditions: + * 1. You must determine exactly one action for every possible combination of sensor states. + * 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). + * 3. You are not allowed to use logical operators. + * 4. You must use a single switch statement to control the program&#x27;s behaviour. + * 5. Loops may only be used for reading input, not for making decisions. + * 6. The program should handle all possible combinations of the sensors&#x27; active/inactive states and print the appropriate response each time. + -- Example (for understanding): + * If all sensors are inactive, the system should remain idle. + * If some sensors are active, the system should issue warnings or alerts based on the situation. + * If all sensors are active, the system should declare a confirmed intrusion. + */ + +/* + * This program monitors the state of four sensors (Door, Window, Motion, Glass Break) + * and determines the appropriate action without using any conditional (if, else) + * or logical (&amp;&amp;, ||) operators. + * + * It works by combining the state of all sensors into a single integer value + * using bitmasking. Each bit in the integer represents the state of one sensor + * (1 for active, 0 for inactive). This combined state is then used in a single + * switch statement to select the correct action for every possible combination. + * + * Then, enter the state of the four sensors separated by spaces, + * for example: 1 0 1 0 + */ + +/* Author - Amit Dutta, Date - 12th October, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + + // variables to hold the state of a sensor (0 or 1) + int doorSensorState, windowSensorState, motionSensorState, glassbreakSensorState; + + // variable to check the combined state of all four sensor + int combinedState = 0; + + // a invalid flag to check the input are valid or not + unsigned int invalidFlag; + + // printing the way to usage the program + printf(&quot;------ Home Security Controller ------\n&quot;); + printf(&quot;Enter sensor states (1 for active, 0 for inactive).\n&quot;); + printf(&quot;Format: [Door] [Window] [Motion] [Glass Break]\n&quot;); + printf(&quot;Example: 0 1 1 0\n&quot;); + printf(&quot;Enter states (or press Ctrl+D for MacOS or Linux / Ctrl+Z for Windows to exit): &quot;); + + // doing the main calculation + // chacking the combined state and taking a decision + while (scanf(&quot;%d %d %d %d&quot;, &amp;doorSensorState, &amp;windowSensorState, &amp;motionSensorState, &amp;glassbreakSensorState) == 4) + { + // validating input + // The expression (variable &amp; ~1) results in 0 only if &#x27;variable&#x27; is 0 or 1. + // For any other positive number, it&#x27;s non-zero. + // We combine all checks with a bitwise OR. If any sensor state is invalid, + // the flag will become non-zero. + invalidFlag = (doorSensorState &amp; ~1) | (windowSensorState &amp; ~1) | (motionSensorState &amp; ~1) | (glassbreakSensorState &amp; ~1); + + // Combine the four sensor states into a single integer using bitwise operations. + // This creates a unique number from 0 to 15 for each possible combination. + // Bit 0: Door Sensor + // Bit 1: Window Sensor + // Bit 2: Motion Sensor + // Bit 3: Glass Break Sensor + combinedState = (glassbreakSensorState &lt;&lt; 3) | (motionSensorState &lt;&lt; 2) | (windowSensorState &lt;&lt; 1) | doorSensorState; + + // If the invalid_input_flag is non-zero, we add 16 to the state. + // This pushes it outside the 0-15 range and forces the &#x27;default&#x27; case in the switch. + // We achieve this by multiplying the flag (which is &gt; 0) by 16. + combinedState += invalidFlag * 16; + + // printing the given state + printf(&quot;\n\nState : [Door : %d, Window : %d, Motion : %d, Glass Break : %d]\nState Id : %d&quot;, + doorSensorState, windowSensorState, motionSensorState, glassbreakSensorState, combinedState); + printf(&quot;\nSystem Action : &quot;); + + // taking decision based on combined state + // A single switch statement controls the program&#x27;s behavior. + // It handles all 2^4 = 16 possible combinations of sensor states, + // ensuring exactly one action is taken for every scenario. + switch (combinedState) + { + case 0: // Binary: 0000 + printf(&quot;System Idle. All sensors inactive.\n&quot;); + break; + case 1: // Binary: 0001 + printf(&quot;Check front door camera.\n&quot;); + break; + case 2: // Binary: 0010 + printf(&quot;Check window sensors.\n&quot;); + break; + case 3: // Binary: 0011 + printf(&quot;Warning: Perimeter breach suspected. Check doors and windows.\n&quot;); + break; + case 4: // Binary: 0100 + printf(&quot;Check interior cameras for movement.\n&quot;); + break; + case 5: // Binary: 0101 + printf(&quot;Warning: Potential entry and movement detected. Check front door and interior. Ask for patrol.\n&quot;); + break; + case 6: // Binary: 0110 + printf(&quot;Warning: Potential entry and movement detected. Check windows and interior. Ask for patrol.\n&quot;); + break; + case 7: // Binary: 0111 + printf(&quot;Alert: High probability of unauthorized entry. Ask for patrol.\n&quot;); + break; + case 8: // Binary: 1000 + printf(&quot;Alert: Glass break detected. High-priority event. Ask for patrol.\n&quot;); + break; + case 9: // Binary: 1001 + printf(&quot;Severe Alert: Forced entry likely (door + glass). Activate Alarm and Contact authorities.\n&quot;); + break; + case 10: // Binary: 1010 + printf(&quot;Severe Alert: Forced entry likely (window + glass). Activate Alarm and Contact authorities.\n&quot;); + break; + case 11: // Binary: 1011 + printf(&quot;Intrusion Alert: Multiple perimeter breaches. Activate Alarm and Contact authorities.\n&quot;); + break; + case 12: // Binary: 1100 + printf(&quot;Intrusion Alert: Confirmed interior presence after breach. Activate Alarm and Contact authorities.\n&quot;); + break; + case 13: // Binary: 1101 + printf(&quot;INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n&quot;); + break; + case 14: // Binary: 1110 + printf(&quot;INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n&quot;); + break; + case 15: // Binary: 1111 + printf(&quot;CATASTROPHIC EVENT! ALL SENSORS TRIGGERED. ACTIVATE ALARM AND CONTACT COPS.\n&quot;); + break; + default: + // This case should not be reached with valid 0/1 input but is included for completeness. + printf(&quot;Error: Invalid sensor state detected.\n&quot;); + break; + } + + // discarding extra characters (if any) left + while (getchar() != &#x27;\n&#x27;) + ; + + // asking for next set of input + printf(&quot;\nEnter next set of states: &quot;); + } + printf(&quot;\nSecurity system shutting down.\n&quot;); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-challenge-sudiptoown01-c', 'sudiptoown01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudiptoown01.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">sudiptoown01.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/challenge/sudiptoown01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-challenge-sudiptoown01-c" style="display:none;">/* + * A smart home security controller monitors the state of several sensors to decide what action to take. + * Each second, the system reads data from sensors that are either an active or inactive. Based on the current + * state of all sensors, the controller must perform exactly one action, such as activating a warning, checking + * a specific zone, or declaring an intrusion. Write a C program that reads the sensor status as input and + * prints the corresponding system action. + * Hints: + * 1. The most determinative action wins for every possible combination of sensor states. + * 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). + * 3. You are not allowed to use logical operators. + * 4. You must use a single switch statement to control the program&#x27;s behavior. + * 5. The program should handle all possible combinations of the sensors&#x27; active/inactive states and print the appropriate response each time. + * 6. All sensors are inactive, the system should remain idle. + * 7. If some sensors are active, the system should issue warnings or alerts based on the situation. + * 8. If all sensors are active, the system should declare a confirmed intrusion. + * Solution: + * We can solve this problem simply by assigning each case its own distinct integer. + * There are 2 possibilities for a sensor and therefore there are 2^4 = 16 cases. + * Using arrays we can assign each case its own index value and print it as per the encoded binary integer. + */ +#include &lt;stdio.h&gt; + +int casekey(int door, int window, int motion, int glass) { + int key = (door &lt;&lt; 3) | (window &lt;&lt; 2) | (motion &lt;&lt; 1) | glass; + return key; +} + +int main() { + int door, window, motion, glass, key; + char choice; + + static const char *action[16] = { + &quot;IDLE&quot;, &quot;CHECK WINDOW&quot;, &quot;WARN MOTION&quot;, &quot;WARN MOTION WINDOW&quot;, + &quot;CHECK DOOR&quot;, &quot;WARN DOOR WINDOW&quot;, &quot;INTRUSION SUSPECTED&quot;, &quot;INTRUSION CONFIRMED&quot;, + &quot;GLASS ONLY&quot;, &quot;DOOR GLASS&quot;, &quot;MOTION GLASS&quot;, &quot;MOTION WINDOW GLASS&quot;, + &quot;DOOR WINDOW&quot;, &quot;DOOR WINDOW GLASS&quot;, &quot;DOOR MOTION GLASS&quot;, &quot;ALL SENSORS&quot; + }; + + do { + printf(&quot;Sensors: Door, Window, Motion, Glass\n&quot;); + printf(&quot;Enter the state of each sensor in binary (0 or 1): &quot;); + scanf(&quot;%d %d %d %d&quot;, &amp;door, &amp;window, &amp;motion, &amp;glass); + + key = casekey(door, window, motion, glass); + printf(&quot;Action: %s\n&quot;, action[key]); + + printf(&quot;Want to continue? (y/n): &quot;); + scanf(&quot; %c&quot;, &amp;choice); + printf(&quot;\n&quot;); + } while (choice == &#x27;y&#x27; || choice == &#x27;Y&#x27;); + + return 0; +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">internal-practice</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-01-c', 'IP-01.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-01.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-01.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-01.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-01-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to compute the sum and product of digits of an integer using user +defined functions. */ + +#include &lt;stdio.h&gt; + +int sum_of_digits(int); +int product_of_digits(int); + +int main() +{ + int num; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;num); + printf(&quot;\nSum of digits of %d = %d&quot;, num, sum_of_digits(num)); + printf(&quot;\nProduct of digits of %d = %d&quot;, num, product_of_digits(num)); + return 0; +} + +int sum_of_digits(int num) +{ + int sum = 0; + while (num &gt; 0) + { + sum += num % 10; + num /= 10; + } + return sum; +} + +int product_of_digits(int num) +{ + int product = 1; + while (num &gt; 0) + { + product *= num % 10; + num /= 10; + } + return product; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-02-c', 'IP-02.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-02.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-02.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-02.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-02-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to reverse a non-negative integer using a function. */ + +#include &lt;stdio.h&gt; + +int reverse(int); + +int main() +{ + int num; + printf(&quot;Enter a non-negetive integer: &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (num &lt; 0) + { + printf(&quot;\nOnly non-negetive integers are allowed.&quot;); + return 1; + } + printf(&quot;\nReverse of the integer %d = %d&quot;, num, reverse(num)); + return 0; +} + +int reverse(int num) +{ + int rev = 0; + while (num &gt; 0) + { + rev = (rev * 10) + (num % 10); + num /= 10; + } + return rev; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-03-c', 'IP-03.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-03.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-03.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-03.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-03-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to compute the sum of the first n terms of the series using a function: +S=1−2+3−4+5−6+… */ + +#include &lt;stdio.h&gt; + +int sum_of_series(int); + +int main() +{ + int n; + printf(&quot;Enter the n: &quot;); + scanf(&quot;%d&quot;, &amp;n); + printf(&quot;\nSum of the first %d terms of the series = %d&quot;, n, sum_of_series(n)); + return 0; +} + +int sum_of_series(int n) +{ + int sum = 0; + int i; + for (i = 1; i &lt;= n; i++) + { + if (i % 2 == 0) + { + sum -= i; + } + else + { + sum += i; + } + } + return sum; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-04-c', 'IP-04.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-04.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-04.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-04.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-04-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a function to check whether a number is prime or not. Use the same function to +generate all prime numbers less than 100. */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int isPrime(int); + +int main() +{ + int n, i; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (isPrime(n)) + { + printf(&quot;\nInput %d is a Prime Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is not a Prime Number.&quot;, n); + } + printf(&quot;\nPrime Numbers less than 100:&quot;); + for (i = 1; i &lt; 100; i++) + { + if (isPrime(i)) + { + printf(&quot; %d&quot;, i); + } + } + return 0; +} + +int isPrime(int n) +{ + if (n &lt;= 1) + return 0; + if (n == 2) + return 1; + if (n % 2 == 0) + return 0; + + int temp = (int)sqrt(n); + int i; + for (i = 3; i &lt;= temp; i += 2) + { + if (n % i == 0) + { + return 0; + } + } + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-05-c', 'IP-05.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-05.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-05.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-05.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-05-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a function to check whether a given string is a palindrome. Use this function to +determine whether an entered string is Palindrome. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +int isPalindrome(char[]); + +int main() +{ + char input[100]; + int len; + + printf(&quot;Enter the string (Max: 100 Character): &quot;); + fgets(input, sizeof(input), stdin); + len = strlen(input); + + if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) + { + input[len - 1] = &#x27;\0&#x27;; + } + + if (isPalindrome(input)) + { + printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); + } + else + { + printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); + } + + return 0; +} + +int isPalindrome(char str[]) +{ + char *start = str; + char *end; + int len = strlen(str); + + if (len == 0) + { + return 1; + } + + end = str + (len - 1); + + while (start &lt; end) + { + if (*start != *end) + { + return 0; + } + start++; + end--; + } + + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-06-c', 'IP-06.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-06.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-06.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-06.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-06-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program using a function to compute and display all factors of a given number. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void display_factors(int); + +int main() +{ + int num, i; + printf(&quot;Please enter the number to get the factors from it : &quot;); + scanf(&quot;%d&quot;, &amp;num); + display_factors(num); + return 0; +} + +void display_factors(int num) { + int temp = abs(num); + int i; + + if (temp == 0) + { + printf(&quot;\n0 has infinitely many factors (all integers).&quot;); + exit(1); + } + + printf(&quot;\nThe factors of &#x27; %d &#x27; is :- &quot;, num); + printf(&quot;\nPositive : &quot;); + for (i = 1; i &lt;= temp; i++) + if (temp % i == 0) + printf(&quot; %d&quot;, i); + printf(&quot;\nNegative : &quot;); + for (i = 1; i &lt;= temp; i++) + if (temp % i == 0) + printf(&quot; %d&quot;, -i); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-07-c', 'IP-07.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-07.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-07.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-07.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-07-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to swap two numbers using pointers (user-defined function). */ + +#include &lt;stdio.h&gt; + +void swap(int *, int *); + +int main() +{ + int a, b; + printf(&quot;Enter value for a and b: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + printf(&quot;\nBefore Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + swap(&amp;a, &amp;b); + printf(&quot;\nAfter Swap: &quot;); + printf(&quot;\na = %d,\tAddress: %u&quot;, a, &amp;a); + printf(&quot;\nb = %d,\tAddress: %u&quot;, b, &amp;b); + return 0; +} + +void swap(int *a, int *b) +{ + *a = *a ^ *b; + *b = *a ^ *b; + *a = *a ^ *b; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-08-c', 'IP-08.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-08.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-08.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-08.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-08-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program that takes the radius of a circle as input, passes it to a function that +computes area and circumference, and displays results in main(). */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +void area_circumference(double, double *, double *); + +int main() +{ + double r, area, circumference; + printf(&quot;Enter the radius of the circle: &quot;); + scanf(&quot;%lf&quot;, &amp;r); + area_circumference(r, &amp;area, &amp;circumference); + printf(&quot;\nArea of the circle = %g&quot;, area); + printf(&quot;\nCircumference of the circle = %g&quot;, circumference); + return 0; +} + +void area_circumference(double r, double *area, double *circumference) +{ + *area = M_PI * r * r; + *circumference = 2 * M_PI * r; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-09-c', 'IP-09.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-09.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-09.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-09.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-09-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to find the sum of n elements entered by the user. Use dynamic +memory allocation (malloc() or calloc()). */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputarr(int[], int); +int sum_elem(int[], int); + +int main() +{ + int n, *arr; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;n); + arr = (int *)malloc(n * sizeof(int)); + inputarr(arr, n); + printf(&quot;\nSum of the %d element(s) = %d&quot;, n, sum_elem(arr, n)); + free(arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int sum_elem(int arr[], int n) +{ + int i, sum = 0; + for (i = 0; i &lt; n; i++) + { + sum += arr[i]; + } + return sum; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-10-c', 'IP-10.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-10.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-10.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-10.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-10-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a function that reverses the elements of an array in place, using only a single +pointer argument, and return void. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputArray(int[], int); +void printArray(int[], int); +void reverse(int *); + +int main() +{ + int n, i, *arr = NULL; + printf(&quot;Enter the number of element: &quot;); + scanf(&quot;%d&quot;, &amp;n); + arr = (int *)malloc(n * sizeof(int)); + if (arr == NULL) + { + printf(&quot;\nMemory allocation failed.&quot;); + return 1; + } + inputArray(arr, n); + printf(&quot;\nGiven Array: &quot;); + printArray(arr, n); + for (i = 0; i &lt; n; i++) + { + reverse(&amp;arr[i]); + } + printf(&quot;\nUpdated Array: &quot;); + printArray(arr, n); + free(arr); + return 0; +} + +void inputArray(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +void printArray(int arr[], int n) +{ + int i; + printf(&quot;[&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i &lt; n - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]&quot;); +} + +void reverse(int *n) +{ + int temp = *n; + int rev = 0; + while (temp &gt; 0) + { + rev = (rev * 10) + (temp % 10); + temp /= 10; + } + *n = rev; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-11-c', 'IP-11.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-11.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-11.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-11.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-11-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to merge two sorted integer arrays to form a single sorted array. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void merge(int[], int, int[], int); + +int main() +{ + int a[] = {10, 30, 50, 70, 90}; + int b[] = {20, 40, 60, 80, 100}; + int n1 = sizeof(a) / sizeof(a[0]); + int n2 = sizeof(b) / sizeof(b[0]); + merge(a, n1, b, n2); + return 0; +} + +void merge(int a[], int n1, int b[], int n2) +{ + int n = n1 + n2; + int *c = (int *)malloc(n * sizeof(int)); + int i, j, k; + i = j = k = 0; + while (i &lt; n1 &amp;&amp; j &lt; n2) + { + if (a[i] &lt; b[j]) + { + c[k++] = a[i++]; + } + else + { + c[k++] = b[j++]; + } + } + while (i &lt; n1) + { + c[k++] = a[i++]; + } + while (j &lt; n2) + { + c[k++] = b[j++]; + } + printf(&quot;Merged Array:&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %d&quot;, c[i]); + } + free(c); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-12-c', 'IP-12.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-12.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-12.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-12.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-12-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program that reads 10 integers into an array (using pointers), and prints the +array in ascending and descending order. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +#define true 1 +#define false 0 + +void input_arr(int *, int); +void print(int *, int); + +int main() +{ + int arr[10]; + input_arr(arr, 10); + print(arr, 10); + return 0; +} + +void input_arr(int *arr, int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, arr + i); + } +} + +void print(int *arr, int n) +{ + int i, j, isSwaped = true, backup; + int *temp = (int *)malloc(n * sizeof(int)); + if (temp == NULL) + { + printf(&quot;\nMemory Allocation Failed.&quot;); + return; + } + for (i = 0; i &lt; n; i++) + { + *(temp + i) = *(arr + i); + } + for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) + { + isSwaped = false; + for (j = 0; j &lt; n - i - 1; j++) + { + if (*(temp + j) &gt; *(temp + j + 1)) + { + backup = *(temp + j); + *(temp + j) = *(temp + j + 1); + *(temp + j + 1) = backup; + isSwaped = true; + } + } + } + printf(&quot;\nAscending Order:&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %d&quot;, *(temp + i)); + } + printf(&quot;\nDescending Order:&quot;); + for (i = n - 1; i &gt;= 0; i--) + { + printf(&quot; %d&quot;, *(temp + i)); + } + free(temp); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-13-c', 'IP-13.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-13.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-13.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-13.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-13-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to display the Fibonacci series + (i) using recursion + (ii) using iteration +*/ + +#include &lt;stdio.h&gt; + +long long int fib_rec(int); +long long int fib_tail_rec(int, long long int, long long int); +void fib_rec_print(int); +void fib_ite_print(int); + +int main() +{ + int n; + printf(&quot;Enter the number of terms: &quot;); + scanf(&quot;%d&quot;, &amp;n); + fib_rec_print(n); + fib_ite_print(n); + return 0; +} + +long long int fib_rec(int n) +{ + if (n == 0 || n == 1) + { + return n; + } + else + { + return fib_rec(n - 1) + fib_rec(n - 2); + } +} + +long long int fib_tail_rec(int n, long long int t1, long long int t2) +{ + if (n == 0) + { + return t1; + } + else if (n == 1) + { + return t2; + } + else + { + return fib_tail_rec(n - 1, t2, t1 + t2); + } +} + +void fib_rec_print(int n) +{ + int i; + printf(&quot;\nFibonacci Series (Recursion):&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %lld&quot;, fib_rec(i)); + } + printf(&quot;\nFibonacci Series (Tail-Recursion):&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %lld&quot;, fib_tail_rec(i, 0, 1)); + } +} + +void fib_ite_print(int n) +{ + int i; + long long int t1 = 0, t2 = 1, temp; + printf(&quot;\nFibonacci Series (Iteration):&quot;); + if (n &gt; 0) + { + printf(&quot; 0&quot;); + } + if (n &gt; 1) + { + printf(&quot; 1&quot;); + } + for (i = 2; i &lt; n; i++) + { + printf(&quot; %lld&quot;, t1 + t2); + temp = t1; + t1 = t2; + t2 = temp + t2; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-14-c', 'IP-14.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-14.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-14.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-14.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-14-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to calculate the factorial of a number + (i) using recursion + (ii) using iteration +*/ + +#include &lt;stdio.h&gt; + +long long int fact_tail_rec(int, long long int); +long long int fact_rec(int); +long long int fact_ite(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (n &lt; 0) + { + printf(&quot;\nFactorial of negetive number is not possible.&quot;); + return 1; + } + printf(&quot;\nFactorial of %d (Tail-Recursion) = %lld&quot;, n, fact_tail_rec(n, 1)); + printf(&quot;\nFactorial of %d (Recursion) = %lld&quot;, n, fact_rec(n)); + printf(&quot;\nFactorial of %d (Iteration) = %lld&quot;, n, fact_ite(n)); + return 0; +} + +long long int fact_tail_rec(int n, long long int result) +{ + if (n == 0 || n == 1) + { + return result; + } + else + { + return fact_tail_rec(n - 1, n * result); + } +} + +long long int fact_rec(int n) +{ + if (n == 0 || n == 1) + { + return 1; + } + else + { + return n * fact_rec(n - 1); + } +} + +long long int fact_ite(int n) +{ + int i; + long long int result = 1; + if (n == 0 || n == 1) + { + return 1; + } + for (i = 2; i &lt;= n; i++) + { + result *= i; + } + return result; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-15-c', 'IP-15.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-15.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-15.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-15.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-15-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to calculate the GCD of two numbers + (i) using recursion + (ii) without recursion +*/ + +#include &lt;stdio.h&gt; + +int gcd_tail_rec(int, int); +int gcd_rec(int, int); +int gcd_ite(int, int); + +int main() +{ + int a, b; + printf(&quot;Enter two number: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + if (a &lt; 0) + a = -a; + if (b &lt; 0) + b = -b; + printf(&quot;\nGCD (Tail-Recursion) of %d and %d is = %d&quot;, a, b, gcd_tail_rec(a, b)); + printf(&quot;\nGCD (Recursion) of %d and %d is = %d&quot;, a, b, gcd_rec(a, b)); + printf(&quot;\nGCD (Iteration) of %d and %d is = %d&quot;, a, b, gcd_ite(a, b)); + return 0; +} + +int gcd_tail_rec(int a, int b) +{ + if (b == 0) + { + return a; + } + else + { + return gcd_tail_rec(b, a % b); + } +} + +int gcd_rec(int a, int b) +{ + if (b == 0) + { + return a; + } + else + { + return gcd_rec(b, a % b); + } +} + +int gcd_ite(int a, int b) +{ + int temp; + while (b &gt; 0) + { + temp = b; + b = a % b; + a = temp; + } + return a; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-16-c', 'IP-16.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-16.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-16.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-16.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-16-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named isArmstrong with the +signature int isArmstrong(int num);. An Armstrong number is a number that is equal to +the sum of its own digits each raised to the power of the number of digits. For example, +153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int isArmstrong(int); +int count(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + + if (isArmstrong(n)) + { + printf(&quot;\nInput %d is a Armstrong Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is Not a Armstrong Number.&quot;, n); + } + + return 0; +} + +int count(int n) +{ + int count = 0; + while (n &gt; 0) + { + count++; + n = n / 10; + } + return count; +} + +int isArmstrong(int n) +{ + if (n &lt; 0) + return 0; + if (n == 0) + return 1; + + int power = count(n); + int temp = n; + int checker = 0; + + while (temp &gt; 0) + { + int digit = temp % 10; + checker = checker + (int)round(pow(digit, power)); + temp = temp / 10; + } + return n == checker; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-17-c', 'IP-17.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-17.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-17.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-17.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-17-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 03 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named isPerfect with the signature +int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of +its proper divisors, excluding itself. For example, 28 is a perfect number because the sum +of its divisors (1, 2, 4, 7, 14) equals 28. */ + +#include &lt;stdio.h&gt; + +int isPerfect(int); + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (isPerfect(n)) + { + printf(&quot;\nInput %d is a Perfect Number.&quot;, n); + } + else + { + printf(&quot;\nInput %d is not a Perfect Number.&quot;, n); + } + return 0; +} + +int isPerfect(int n) +{ + if (n &lt;= 1) + return 0; + int temp = 1; + int i; + for (i = 2; i &lt;= n / 2; i++) + { + if (n % i == 0) + { + temp += i; + } + } + return temp == n; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-18-c', 'IP-18.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-18.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-18.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-18.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-18-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named findLargest with the +signature int findLargest(int arr[], int size);. The function should take an array of integers +and its size, and return the largest element in the array. */ + +#include &lt;stdio.h&gt; + +void inputArray(int[], int); +int findLargest(int[], int); + +int main() +{ + int size; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + inputArray(arr, size); + printf(&quot;\nLargest Element is: %d&quot;, findLargest(arr, size)); + return 0; +} + +void inputArray(int arr[], int size) +{ + int i; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int findLargest(int arr[], int size) +{ + int largest = arr[0], i; + for (i = 1; i &lt; size; i++) + { + if (largest &lt; arr[i]) + { + largest = arr[i]; + } + } + return largest; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-19-c', 'IP-19.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-19.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-19.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-19.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-19-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a C program that includes a user-defined function named binarySearch with the +signature int binarySearch(int arr[], int size, int target);. The function should perform a +binary search on a sorted array of integers and return the index of the target element if +found, and -1 otherwise. */ + +#include &lt;stdio.h&gt; + +int inputArray(int[], int); +// void sortArray(int[], int); +int binarySearch(int[], int, int); + +int main() +{ + int size; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + int target = inputArray(arr, size); + // sortArray(arr, size); // If needed + int index = binarySearch(arr, size, target); + if (index != -1) + { + printf(&quot;\nElement %d is found at index %d.&quot;, target, index); + } + else + { + printf(&quot;\nElement %d is not found.&quot;, target); + } + return 0; +} + +int inputArray(int arr[], int size) +{ + int i, target; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element for position %d: &quot;, i); + scanf(&quot;%d&quot;, &amp;arr[i]); + } + printf(&quot;\nEnter the target element: &quot;); + scanf(&quot;%d&quot;, &amp;target); + return target; +} + +/* void sortArray(int arr[], int size) +{ + // using Bubble Sort... + + int tempArr[size], i, j, temp; + printf(&quot;\nBefore Sorting:\n[&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i != size - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]\n&quot;); + for (i = 0; i &lt; size - 1; i++) + { + for (j = 0; j &lt; size - i - 1; j++) + { + if (arr[j] &gt; arr[j + 1]) + { + temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + } + printf(&quot;\nAfter Sorting:\n[&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i != size - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]\n&quot;); +} +*/ + +int binarySearch(int arr[], int size, int target) +{ + int low = 0; + int high = size - 1; + int mid; + while (low &lt;= high) + { + mid = low + ((high - low) / 2); + if (arr[mid] == target) + { + return mid; + } + else if (arr[mid] &gt; target) + { + high = mid - 1; + } + else if (arr[mid] &lt; target) + { + low = mid + 1; + } + } + return -1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-internal-practice-IP-20-c', 'IP-20.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-20.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">IP-20.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/internal-practice/IP-20.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-internal-practice-IP-20-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 03 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a C program that defines an array of integers, and includes a user-defined function +named reverseArray with the signature void reverseArray(int arr[], int size);. The function +should reverse the elements of the array. */ + +#include &lt;stdio.h&gt; + +void inputArray(int[], int); +void reverseArray(int[], int); + +int main() +{ + int size; + printf(&quot;How many element do you want to add: &quot;); + scanf(&quot;%d&quot;, &amp;size); + int arr[size]; + inputArray(arr, size); + reverseArray(arr, size); + return 0; +} + +void inputArray(int arr[], int size) +{ + int i; + for (i = 0; i &lt; size; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +void reverseArray(int arr[], int size) +{ + int i, j, temp; + printf(&quot;\nBefore Reverse: \n&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); + } + for (i = 0, j = size - 1; i &lt; j; i++, j--) + { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + printf(&quot;\nAfter Reverse: \n&quot;); + for (i = 0; i &lt; size; i++) + { + printf(&quot;Position: %d, Value: %d\n&quot;, i, arr[i]); + } +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">khurapati-idea</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI001-c', 'KI001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-khurapati-idea-KI001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +// khurapati idea no. : 1 +// Idea : we can use the side effect of printf function to get length of any string or number +// Author - Amit Dutta, Date - 16-10-2025 + +#include &lt;stdio.h&gt; +int main() +{ + // testing number + int num, len = -13 /* here minus 13 because we will remove the massage characters in line 10 */; + printf(&quot;Enter a number to get the length : &quot;); + scanf(&quot;%d&quot;, &amp;num); + len += printf(&quot;Your input : %d&quot;, num); // here the &quot;Your input : &quot;, this 13 characters are extra + printf(&quot;\nLength : %d&quot;, len); + + // testing char + char a[20]; + len = -13; + while (getchar() != &#x27;\n&#x27;) + ; + printf(&quot;\nEnter a word to get the length : &quot;); + scanf(&quot;%19s&quot;, &amp;a); + len += printf(&quot;Your input : %s&quot;, a); // here the &quot;Your input : &quot;, this 13 characters are extra + printf(&quot;\nLength : %d&quot;, len); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI002-c', 'KI002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-khurapati-idea-KI002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Author - Amit Dutta, Date - 05th November, 2025 */ + +/* Plan - checking for edge case */ + +#include &lt;stdio.h&gt; +int main() +{ + printf(&quot;Starting.....\n&quot;); + + for (int i = 1; ; i++) + { + printf(&quot;i = %d\n&quot;, i); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-khurapati-idea-KI003-c', 'KI003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">KI003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/khurapati-idea/KI003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-khurapati-idea-KI003-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 24 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Bubble sort (with swap) */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;stdbool.h&gt; + +void inputarr(int **, int); +void display(int[], int); +int asort(int *, int); +int dsort(int *, int); + +int main() +{ + int *arr = NULL, n, choice; + do + { + printf(&quot;\nEnter element count: &quot;); + if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) + { + printf(&quot;\nERROR: Invalid element count!!! Try again...&quot;); + } + else + { + break; + } + } while (true); + inputarr(&amp;arr, n); + + while (true) + { + printf(&quot;\n1. Sort in Ascending Order.&quot; + &quot;\n2. Sort in Descending Order&quot; + &quot;\n3. Change Input&quot; + &quot;\n0. Exit&quot; + &quot;\nYour choice: &quot;); + do + { + if (scanf(&quot;%d&quot;, &amp;choice) != 1) + { + printf(&quot;\nInvalid Choice!!! Try again...&quot;); + while (getchar() != &#x27;\n&#x27;) + ; + } + else + { + break; + } + } while (true); + + switch (choice) + { + case 1: + printf(&quot;\n === Selected Mode: Ascending Order ===\n&quot;); + if (!asort(arr, n)) + { + printf(&quot;\nElements are already sorted.\n&quot;); + display(arr, n); + } + printf(&quot;\n&quot;); + break; + case 2: + printf(&quot;\n === Selected Mode: Descending Order ===\n&quot;); + if (!dsort(arr, n)) + { + printf(&quot;\nElements are already sorted.\n&quot;); + display(arr, n); + } + printf(&quot;\n&quot;); + break; + case 3: + do + { + printf(&quot;\nEnter element count: &quot;); + if (scanf(&quot;%d&quot;, &amp;n) != 1 || n &lt; 1) + { + printf(&quot;\nERROR: Invalid element count!!! Try again...&quot;); + } + else + { + break; + } + } while (true); + free(arr); + inputarr(&amp;arr, n); + break; + case 0: + printf(&quot;\nExiting Program...\n&quot;); + free(arr); + return 0; + default: + printf(&quot;\nInvalid Choice!!! Try again...&quot;); + } + } +} + +void inputarr(int **arr, int n) +{ + int i; + if (n &lt; 1) + { + printf(&quot;\nInvalid element number.&quot;); + return; + } + *arr = (int *)malloc(n * sizeof(int)); + if (*arr == NULL) + { + printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); + exit(1); + } + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter Element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;((*arr)[i])); + } +} + +void display(int arr[], int n) +{ + int i; + printf(&quot;[&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot;%d&quot;, arr[i]); + if (i != n - 1) + { + printf(&quot;, &quot;); + } + } + printf(&quot;]&quot;); +} + +int asort(int *arr, int n) +{ + bool isSwaped = true; + int i, j, tempNum, swapCount = 0; + int *temp = (int *)malloc(n * sizeof(int)); + if (temp == NULL) + { + printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); + free(arr); + exit(1); + } + for (i = 0; i &lt; n; i++) + { + temp[i] = *(arr + i); + } + for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) + { + isSwaped = false; + for (j = 0; j &lt; n - i - 1; j++) + { + if (temp[j] &gt; temp[j + 1]) + { + tempNum = temp[j]; + temp[j] = temp[j + 1]; + temp[j + 1] = tempNum; + isSwaped = true; + swapCount++; + } + } + } + if (swapCount &gt; 0) + { + display(temp, n); + } + free(temp); + return swapCount; +} + +int dsort(int *arr, int n) +{ + bool isSwaped = true; + int i, j, tempNum, swapCount = 0; + int *temp = (int *)malloc(n * sizeof(int)); + if (temp == NULL) + { + printf(&quot;\nERROR: Memory Allocation falied.\nExiting Program...\n&quot;); + free(arr); + exit(1); + } + for (i = 0; i &lt; n; i++) + { + temp[i] = *(arr + i); + } + for (i = 0; i &lt; n - 1 &amp;&amp; isSwaped == true; i++) + { + isSwaped = false; + for (j = 0; j &lt; n - i - 1; j++) + { + if (temp[j] &lt; temp[j + 1]) + { + tempNum = temp[j]; + temp[j] = temp[j + 1]; + temp[j + 1] = tempNum; + isSwaped = true; + swapCount++; + } + } + } + if (swapCount &gt; 0) + { + display(temp, n); + } + free(temp); + return swapCount; +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">letusc</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc001-c', 'luc001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Temperature of a city in fahrenheit degrees is input through +the keyboard. WAP to convert this temperature into Centigrade +degrees. */ +/* Author - Amit Dutta, Date - 13 sep, 2025 */ +/* Chapter 1; Page 19; Question NO.: F(a) */ + +#include&lt;stdio.h&gt; +int main() { + float f, c; + printf(&quot;Enter the temperature of city in Fahrenheit : &quot;); + scanf(&quot;%f&quot;, &amp;f); + // formula (F - 32) 5/9 + c = ((f - 32) * 5) / 9; + printf(&quot;\nTemperature in centigrade : %f&quot;, c); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc002-c', 'luc002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* The length and breadth of a rectangle and radius of a circle +are input through the keyboard. Write a program to calculate the +area and perimeter of the rectangle, and the area and circumference +of the circle. */ +/* Author - Amit Dutta, Date - 16th SEP, 2025 */ +/* Let Us C; Page - 19; Chap- 1; QNo.: F(b) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double len, bre, r, area_r, per, area_c, cir; + printf(&quot;Enter the length and breadth of the rectangle : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;len, &amp;bre); + printf(&quot;Enter the Radius of the circle : &quot;); + scanf(&quot;%lf&quot;, &amp;r); + area_r = len * bre; + per = 2 * (len + bre); + area_c = M_PI * r * r; + cir = 2 * M_PI * r; + printf(&quot;\nArea of Rectangle : %lf&quot; + &quot;\nPerimeter of Rectangle : %lf&quot; + &quot;\nArea of Circle : %lf&quot; + &quot;\nCircumference of Circle : %lf&quot;, + area_r, per, area_c, cir); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc003-c', 'luc003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Paper of size AO has dimensions 1189 mm x 841 mm. +Each subsequent size A(n) is defined as A(n-1) cut in +half, parallel to its shorter sides. Thus, paper of +size A1 would have dimensions 841 mm x 594 mm. Write +a program to calculate and print paper sizes A0,� +A1,�A2,�...�A8. */ +/* Author - Amit Dutta, Date - 16th SEP, 2025 */ +/* Let Us C; Page - 19; Chap- 1; QNo.: F(c) */ + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double s_long = 1189.0, s_short = 841.0, temp; + int i; + printf(&quot;A0 Dimension : %g mm x %g mm&quot;, floor(s_long), floor(s_short)); + for (i = 1; i &lt;= 8; i++) { + temp = s_long; + s_long = s_short; + s_short = temp / 2; + printf(&quot;\nA%d Dimension : %g mm x %g mm&quot;, i, floor(s_long), floor(s_short)); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc004-c', 'luc004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* If a five digit number is input through the keyboard, +write a program to calculate the sum of it&#x27;s digit. +(Hint : Use the modulus operator %) */ +/* Author - Amit Dutta, Date - 28th SEP, 2025 */ +/* Let Us C; Page - 37; Chap- 2; QNo.: G(a) */ + +#include &lt;stdio.h&gt; +int main() +{ + int inp, result = 0, i, temp; + printf(&quot;Enter a five digit number : &quot;); + scanf(&quot;%d&quot;, &amp;inp); + if (inp &lt; 10000 || inp &gt; 99999) + { + printf(&quot;\nPlease enter a valid five digit number.&quot;); + return 1; + } + temp = inp; + for (i = 1; i &lt;= 5; i++) + { + result = result + (inp % 10); + inp = inp / 10; + } + printf(&quot;\nSum of the digit &#x27;%d&#x27; is : %d&quot;, temp, result); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc005-c', 'luc005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to recive Cartesian +co-ordinates (x, y) of a point and convert +them into Polar co-ordinates (r, phi) + Hint : r = sqrt (x^2 + y^2) and phi = tan^-1 (y/x) */ +/* Author - Amit Dutta, Date - 28th SEP, 2025 */ +/* Let Us C; Page - 37; Chap- 2; QNo.: G(b) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double x, y, r, phi; + printf(&quot;Enter the Cartesian Co-Ordinates in this format &#x27;x, y&#x27; : &quot;); + scanf(&quot;%lf, %lf&quot;, &amp;x, &amp;y); + r = sqrt(pow(x, 2) + pow(y, 2)); + phi = atan2(y, x); + printf(&quot;\nPolar Co-Ordinates are : (%g, %g Rad)&quot;, r, phi); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc006-c', 'luc006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to receive values of latitude (L1, L2) and longitude +(G1, G2), in degrees, of two places on the earth and output the distance +(D) between them in nautical miles. The formula for distance in nautical +miles is : + D = 3963 cos^-1(sin L1 sin L2 + cos L1 cos L2 * cos(G2 - G1)) +*/ +/* Author - Amit Dutta, Date - 29th SEP, 2025 */ +/* Let Us C, Chap - 2, Page - 37, Qn no.: G(c) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double l1, l2, g1, g2, d; + printf(&quot;Enter the Latitude in &#x27;L1, L2&#x27; format : &quot;); + scanf(&quot;%lf, %lf&quot;, &amp;l1, &amp;l2); + printf(&quot;Enter the Longitude in &#x27;G1, G2&#x27; format : &quot;); + scanf(&quot;%lf, %lf&quot;, &amp;g1, &amp;g2); + // Converting degree to radian because function from math.h use radian not degree + l1 = l1 * (M_PI / 180); + l2 = l2 * (M_PI / 180); + g1 = g1 * (M_PI / 180); + g2 = g2 * (M_PI / 180); + d = 3963 * acos(sin(l1) * sin(l2) + cos(l1) * cos(l2) * cos(g2 - g1)); + printf(&quot;Distance in nautical miles : %g&quot;, d); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc007-c', 'luc007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Wind-chill factor is the felt air temperature on exposed skin due to wind. +The wind-chill temperature is always lower than the air temperature, and is +calculated as per the following formula. + wcf = 35.74 + 0.6215t + (0.4275t - 35.75) * v^0.16 +Where t is temperature and v is wind velocity. Write a program to receive +values of t and v and calcualate wind-chill factor (wcf). */ +/* Author - Amit Dutta, Date - 30th SEP, 2025 */ +/* Let Us C, Chap - 2, Page - 37, Qn No.: G(d) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double t, v, wcf; + printf(&quot;Enter the temperature and velociy of the wind : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;t, &amp;v); + wcf = 35.74 + (0.6215 * t) + (((0.4275 * t) - 35.75) * pow(v, 0.16)); + printf(&quot;\nWind-chill factor (wcf) : %g&quot;, wcf); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc008-c', 'luc008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc008-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* If value of an angle is input through the keyboard, +write a program to print all its trigonometric ratios. */ +/* Author - Amit Dutta, Date - 30th SEP, 2025 */ +/* Let Us C, Chap - 2, Page - 37, Qn No.: G(e) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double inp, rsin, rcos, rtan, rcosec, rsec, rcot; + printf(&quot;Enter the Angle in degree : &quot;); + scanf(&quot;%lf&quot;, &amp;inp); + inp = inp * (M_PI / 180); //changing degree to radian + rsin = sin(inp); + rcos = cos(inp); + rtan = tan(inp); + rcosec = 1 / rsin; + rsec = 1 / rcos; + rcot = 1 / rtan; + printf(&quot;\nTrigonometric ratios :-&quot; + &quot;\nsin = %g &quot; + &quot;\ncos = %g&quot; + &quot;\ntan = %g&quot; + &quot;\ncosec = %g&quot; + &quot;\nsec = %g&quot; + &quot;\ncot = %g&quot;, + rsin, rcos, rtan, rcosec, rsec, rcot); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc009-c', 'luc009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc009.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc009.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc009-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Two numbers are input through the keyboard into two locations +C and D. Write a program to interchange the contents of C and D. */ +/* Author - Amit Dutta, Date - 30th SEP, 2025 */ +/* Let Us C, Chap - 2, Page - 37, Qn No.: G(d) */ + +#include &lt;stdio.h&gt; +int main() +{ + double a, b; + printf(&quot;Enter the two number A and B : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;a, &amp;b); + printf(&quot;\nBefore Interchange : &quot;); + printf(&quot;\nA = %g (Memory location = %p)&quot;, a, &amp;a); + printf(&quot;\nB = %g (Memory location = %p)&quot;, b, &amp;b); + a = a + b; + b = a - b; + a = a - b; + printf(&quot;\nAfter Interchange :&quot;); + printf(&quot;\nA = %g (Memory location = %p)&quot;, a, &amp;a); + printf(&quot;\nB = %g (Memory location = %p)&quot;, b, &amp;b); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc010-c', 'luc010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc010.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc010.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc010-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* A five-digit number is entered through the keyboard. Write a program +to obtain the reversed number and to etermine whether the original and reversed +numbers are equal or not. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap - 3, Page - 53, Qn No.: f(a) */ + +#include &lt;stdio.h&gt; +int main() +{ + int num, rev, temp, i; + printf(&quot;Please enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + if (num &lt; 10000 || num &gt; 99999) + { + printf(&quot;\nPlease enter a five digit number.&quot;); + return 1; + } + temp = num; + for (i = 1; i &lt;= 5; i++) + { + rev = (rev * 10) + num % 10; + num = num / 10; + } + printf(&quot;\nReverse of the Input number : %d&quot;, rev); + if (rev == temp) + printf(&quot;\nOriginal and reversed numbers are equal.&quot;); + else + printf(&quot;\nOrigianl and reversed numbers are not equal.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc011-c', 'luc011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc011.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc011.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc011-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* If ages of Ram, Shyam and Ajay are input through the keyboard, +write a program to determine the youngest of the three. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(b) */ + +#include &lt;stdio.h&gt; +int main() +{ + int ram, shyam, ajay; + printf(&quot;Please enter the age of Ram, Shyam and Ajay : &quot;); + scanf(&quot;%d %d %d&quot;, &amp;ram, &amp;shyam, &amp;ajay); + if (ram == shyam || ram == ajay || shyam == ajay) + printf(&quot;\nThree must have different age.&quot;); + if (ram &lt; shyam &amp;&amp; ram &lt; ajay) + printf(&quot;\nRam is the youngest. Age : %d&quot;, ram); + if (shyam &lt; ram &amp;&amp; shyam &lt; ajay) + printf(&quot;\nShyam is the youngest. Age : %d&quot;, shyam); + if (ajay &lt; ram &amp;&amp; ajay &lt; shyam) + printf(&quot;\nAjay is the youngest. Age : %d&quot;, ajay); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc012-c', 'luc012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc012.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc012.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc012-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check whether a triangle is valid or not, +if three angles of the triangle are entered through the keyboard. +A triangle is valid if the sum of all the three angles is equal to 180 degrees. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(c) */ + +#include &lt;stdio.h&gt; +int main() +{ + double angle1, angle2, angle3, sum; + printf(&quot;Enter the value of the three angle of the triangle : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;angle1, &amp;angle2, &amp;angle3); + sum = angle1 + angle2 + angle3; + if (sum == 180.0) + printf(&quot;\nThis Triangle is a valid one.&quot;); + else + printf(&quot;\nThis Triangle is not valid. Sum of the angles : %g&quot;, sum); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc013-c', 'luc013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc013.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc013.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc013-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the absolute value +of a number entered through the keyboard. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(d) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double num; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%lf&quot;, &amp;num); + num = abs(num); + printf(&quot;\nAbsolute value of the input is : %g&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc014-c', 'luc014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc014.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc014.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc014-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Given the length and breadth of a rectangle, write a program to find +whether the area of the rectangle is greater than it&#x27;s perimeter. +For example, the area of the rectangle with length = 5 and breadth = 4 +is greater than its perimeter. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(e) */ + +#include &lt;stdio.h&gt; +int main() +{ + double len, bre, area, peri; + printf(&quot;Enter the length and breadth of the rectangle : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;len, &amp;bre); + area = len * bre; + peri = 2 * (len + bre); + if (area &gt; peri) + printf(&quot;\nThe area of the rectangle is greater than it&#x27;s perimeter.&quot;); + else if (area &lt; peri) + printf(&quot;\nThe area of the rectangle is lower than it&#x27;s perimeter.&quot;); + else + printf(&quot;\nThe area of the rectangle is same as it&#x27;s perimeter.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc015-c', 'luc015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc015.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc015.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc015-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Given three points (x1, y1), (x2, y2), and (x3, y3), +write a program to check if the three poins fall on one straight line. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(f) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#define EPSILON 0.0001 +// Define a small tolerance value (EPSILON) for safe floating-point comparison +// This is critical because of minor rounding errors in computer arithmetic. +int main() +{ + double x1, x2, x3, y1, y2, y3, area; + printf(&quot;Enter the point A(x1, y1) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;x1, &amp;y1); + printf(&quot;Enter the point B(x2, y2) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;x2, &amp;y2); + printf(&quot;Enter the point C(x3, y3) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;x3, &amp;y3); + area = 0.5 * ((x1 * (y2 - y3)) + (x2 * (y3 - y1)) + (x3 * (y1 - y2))); + if (fabs(area) &lt; EPSILON) // abs() for integer, fabs() for float, double + printf(&quot;\nA(%g, %g), B(%g, %g) and C(%g, %g) points fall on one straight line.&quot;, x1, y1, x2, y2, x3, y3); + else + printf(&quot;\nA(%g, %g), B(%g, %g) and C(%g, %g) points doesn&#x27;t fall on one straight line.&quot;, x1, y1, x2, y2, x3, y3); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc016-c', 'luc016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc016.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc016.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc016-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Given the coordiantes (x, y) of center of a circle and its radius, +write a program that will determine whether a point lies inside the circle, +on the circle or outside the circle. (Hint : Use sqrt() and pow() functions.) */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(g) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +// Define a small tolerance value (EPSILON) for reliable floating-point comparison +#define EPSILON 0.0001 + +int main() +{ + double h, k; + double R; + double x, y; + double distance_sq; + printf(&quot;Enter the center coordinates (h, k) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;h, &amp;k); + printf(&quot;Enter the radius (R) : &quot;); + scanf(&quot;%lf&quot;, &amp;R); + printf(&quot;Enter the point P coordinates (x, y) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;x, &amp;y); + distance_sq = pow(x - h, 2) + pow(y - k, 2); + double radius_sq = R * R; + // Case 1: On the circle (D^2 = R^2) - Use EPSILON for safety! + if (fabs(distance_sq - radius_sq) &lt; EPSILON) + { + printf(&quot;The point P(%g, %g) lies ON THE CIRCLE.\n&quot;, x, y); + } + // Case 2: Inside the circle (D^2 &lt; R^2) + else if (distance_sq &lt; radius_sq) + { + printf(&quot;The point P(%g, %g) lies INSIDE THE CIRCLE.\n&quot;, x, y); + } + // Case 3: Outside the circle (D^2 &gt; R^2) + else + { + printf(&quot;The point P(%g, %g) lies OUTSIDE THE CIRCLE.\n&quot;, x, y); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc017-c', 'luc017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc017.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc017.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc017-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Given a point (x, y), write a program to find out if it lies on X-axis, Y-axis or origin. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(h) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#define EPSILON 0.00001 + +int main() +{ + double x, y; + printf(&quot;Enter the point P(x, y) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;x, &amp;y); + if (fabs(x) &lt; EPSILON &amp;&amp; fabs(y) &lt; EPSILON) + printf(&quot;\nPoint P(%g, %g) lies on the origin.&quot;, x, y); + else if (fabs(x) &lt; EPSILON) + printf(&quot;\nPoint P(%g, %g) lies on the Y-Axis.&quot;, x, y); + else if (fabs(y) &lt; EPSILON) + printf(&quot;\nPoint P(%G, %g) lies on the X-Axis.&quot;, x, y); + else + printf(&quot;\nThe point P(%g, %g) lies in a QUADRANT (not on an axis or the origin).&quot;, x, y); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc018-logic-c', 'luc018-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018-logic.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc018-logic.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc018-logic-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* According to Gregorian calender, it was Monday on the date 01/01/01. +Write a program to find out what is the day on 1st January of any input year. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(i) */ + +#include &lt;stdio.h&gt; + +/** + * @brief Determines if a given year is a leap year. + * * The rule: A year is a leap year if it is divisible by 4, UNLESS it is + * divisible by 100 but NOT by 400. + * * @param year The year to check. + * @return 1 if it is a leap year, 0 otherwise. + */ +int is_leap(int year) { + // Check if divisible by 400 OR (divisible by 4 AND not divisible by 100) + if ((year % 400 == 0) || (year % 4 == 0 &amp;&amp; year % 100 != 0)) { + return 1; + } + return 0; +} + +/** + * @brief Calculates the day of the week for January 1st of the given year. + * * The base date is 01/01/01, which was a Monday (index 1). + * * Day Mapping: 0:Sunday, 1:Monday, 2:Tuesday, 3:Wednesday, 4:Thursday, 5:Friday, 6:Saturday + */ +int main() { + long long year; // Use long long for year input if years far in the future/past are tested + int i; + long long total_days = 0; + int day_index; + + // Day names array for output + const char *day_names[] = {&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}; + + printf(&quot;Enter the year (e.g., 2025): &quot;); + if (scanf(&quot;%lld&quot;, &amp;year) != 1 || year &lt; 1) { + printf(&quot;Invalid year input. Please enter a positive integer year (&gt;= 1).\n&quot;); + return 1; + } + + // --- Core Logic: Calculate Total Days --- + + // We only need to consider the years that have *passed* before the target year. + // So, we count days from the end of year 0 up to the end of year (year - 1). + int years_passed = year - 1; + + // 1. Calculate the number of leap days up to the end of year (year - 1) + // Formula based on Gregorian calendar rules for years Y-1: + // (Y-1)/4 - (Y-1)/100 + (Y-1)/400 + long long leap_years = years_passed / 4 - years_passed / 100 + years_passed / 400; + + // 2. Total days = (Number of years * 365) + (Number of leap years) + // Note: The loop method (below) is more intuitive but the formula is faster. + // We will use the direct formula for efficiency. + total_days = years_passed * 365 + leap_years; + + // --- Alternate Loop Method (for conceptual simplicity) --- + /* + for (i = 1; i &lt; year; i++) { + total_days += 365; + if (is_leap(i)) { + total_days += 1; // Add 1 for the leap day + } + } + */ + + // --- Determine the Day of the Week --- + + // Since 01/01/01 was Monday (index 1), we use the following setup: + // Index 1 corresponds to Monday. + // The calculation gives the number of days *past* the Monday start (01/01/01). + // The modulo operation gives the remainder (0-6). + + // 0 days elapsed (Year 1): total_days=0. (0 + 1) % 7 = 1 (Monday). Correct. + // 365 days elapsed (Year 2): total_days=365. (365 + 1) % 7 = 2 (Tuesday). Correct. (365 mod 7 = 1, 1+1 = 2) + + day_index = (total_days + 1) % 7; + + // Correct the Day Index to match the array (0:Sun, 1:Mon, ..., 6:Sat) + // The +1 adjusts for the Monday starting point (index 1). + + printf(&quot;\nOn January 1st, %lld, the day was: **%s**.\n&quot;, year, day_names[day_index]); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc018-c', 'luc018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc018.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc018-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* According to Gregorian calender, it was Monday on the date 01/01/01. +if any year is input through the keyboard write a program to find out +what is the day on 1st January of this year. */ +/* Author - Amit Dutta, Date - 1st OCT, 2025 */ +/* Let Us C, Chap- 3, Page - 53, Qn No.: f(i) */ + +#include &lt;stdio.h&gt; + +int is_leap(int year) { + if ((year % 400 == 0) || (year % 4 == 0 &amp;&amp; year % 100 != 0)) { + return 1; + } + return 0; +} + +int main() { + long long year; // long long for year input if years far in the future/past are tested + int i; + long long total_days = 0; + int day_index; + + // Day names array for output + const char *day_names[] = {&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}; + + printf(&quot;Enter the year (e.g., 2025): &quot;); + if (scanf(&quot;%lld&quot;, &amp;year) != 1 || year &lt; 1) { + printf(&quot;Invalid year input. Please enter a positive integer year (&gt;= 1).\n&quot;); + return 1; + } + int years_passed = year - 1; + long long leap_years = years_passed / 4 - years_passed / 100 + years_passed / 400; + total_days = years_passed * 365 + leap_years; + day_index = (total_days + 1) % 7; + printf(&quot;\nOn January 1st, %lld, the day was: %s.\n&quot;, year, day_names[day_index]); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc019-c', 'luc019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc019.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc019.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc019-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* If the length of three sides of a triangle are entered through the +keyboard, write a program to check whether the triangle is an isosceles, +an equilateral, a scalene or a right-angled triangle. */ +/* Author - Amit Dutta, Date - 3rd OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 71, Qn No.: D(a) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +#define EPSILON 0.000001 +/* EPSILON is used to compare double values for approximate equality, +mitigating floating-point precision errors. */ + +int main() +{ + double side1, side2, side3; + printf(&quot;Please enter the length of three side of the triangle : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;side1, &amp;side2, &amp;side3); + if (side1 &lt; 1 || side2 &lt; 1 || side3 &lt; 1) + { + printf(&quot;\nLength of a side of triangle should be a positive integer.&quot;); + return 1; + } + if (side1 + side2 &lt; side3 || side1 + side3 &lt; side2 || side2 + side3 &lt; side1) + { + printf(&quot;\nEntered triangle is not VALID.&quot;); + return 1; + } + // isosceles check + if (side1 == side2 || side2 == side3 || side3 == side1) + printf(&quot;\nEntered triangle is a ISOSCELES triangle.&quot;); + else + printf(&quot;\nEntered triangle is NOT a ISOSCELES triangle.&quot;); + // equilateral check + if (side1 == side2 &amp;&amp; side2 == side3) + printf(&quot;\nEntered triangle is a EQUILATERAL triangle.&quot;); + else + printf(&quot;\nEntered triangle is NOT a EQUILATERAL triangle.&quot;); + // scalene check + if (side1 != side2 &amp;&amp; side2 != side3) + printf(&quot;\nEntered triangle is a SCALENE triangle.&quot;); + else + printf(&quot;\nEntered triangle is NOT a SCALENE triangle.&quot;); + // right-angle check + if (fabs(((side1 * side1) + (side2 * side2)) - (side3 * side3)) &lt; EPSILON || + fabs(((side2 * side2) + (side3 * side3)) - (side1 * side1)) &lt; EPSILON || + fabs(((side3 * side3) + (side1 * side1)) - (side2 * side2)) &lt; EPSILON) + printf(&quot;\nEntered triangle is a RIGHT-ANGLED triangle.&quot;); + else + printf(&quot;\nEntered triangle is NOT a RIGHT-ANGLED triangle.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc020-c', 'luc020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc020.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc020.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc020-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* In digital world colors are specified in Red-Green-Blue (RGB) format, +with values of R, G, B varying on an integer scale from 0 to 255. In print +publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, +with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. +Write a program that converts RGB color to CMYK color as per the following formulae: + White = Max(Red/255, Green/255, Blue/255) + Cyan = (White-Red/255) / White + Magenta = (White-Green/255) / White + Yellow = (White-Blue/255) / White + Black = 1 - White +Note that if the RGB values are all 0, then the CMY values are all 0 and the K value is 1. */ +/* Author - Amit Dutta, Date - 4th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 71, Qn No.: D(b) */ + +#include &lt;stdio.h&gt; + +// declaring function +double get_white(double red, double green, double blue) +{ + double max; + max = red / 255; + if (max &lt; (green / 255)) + max = green / 255; + if (max &lt; (blue / 255)) + max = blue / 255; + return max; +} + +int main() +{ + double r, g, b, w, c = 0, m = 0, y = 0, k = 0; + printf(&quot;Enter the RGB color code in &#x27;R G B&#x27; format : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;r, &amp;g, &amp;b); + + // checking for invalid input (negetive input) + if (r &lt; 0 || g &lt; 0 || b &lt; 0) + { + printf(&quot;\nRGB color code can not be a negetive number.&quot;); + return 1; + } + + // checking for invalid input (out of range color code) + if (r &gt; 255 || g &gt; 255 || b &gt; 255) + { + printf(&quot;\nRGB color code can be maximum (255, 255, 255).&quot;); + return 1; + } + + // converting RGB color code to CMYK color code + if (r == 0 &amp;&amp; g == 0 &amp;&amp; b == 0) + k = 1; + else + { + w = get_white(r, g, b); + c = (w - (r / 255)) / w; + m = (w - (g / 255)) / w; + y = (w - (b / 255)) / w; + k = 1 - w; + } + + printf(&quot;\nRGB color (%g, %g, %g) equivalent to CMYK color (%g, %g, %g, %g).&quot;, r, g, b, c, m, y, k); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc021-c', 'luc021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc021.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc021.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc021-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* A certain grade of steel is graded according to the following conditions: + (i) Hardness must be greater than 50 + (ii) Carbon content must be less than 0.7 + (iii) Tensile strength must be greater than 5600 + +The grades are as follows: + Grade is 10 if all three conditions are met + Grade is 9 if conditions (i) and (ii) are met + Grade is 8 if conditions (ii) and (iii) are met + Grade is 7 if conditions (i) and (iii) are met + Grade is 6 if only one condition is met + Grade is 5 if none of the conditions are met + +Write a program, which will require the user to give values of hardness, +carbon content and tensile strength of the steel under consideration and output +the grade of the steel. */ + +/* Author - Amit Dutta, Date - 4th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 71, Qn No.: D(c) */ + +#include &lt;stdio.h&gt; +int main() +{ + double hardness, carbon_content, tensile_strength; + printf(&quot;Enter the details of the steel below - \n&quot;); + printf(&quot;1. Hardness : &quot;); + scanf(&quot;%lf&quot;, &amp;hardness); + printf(&quot;2. Carbon Content : &quot;); + scanf(&quot;%lf&quot;, &amp;carbon_content); + printf(&quot;3. Tensile Strength : &quot;); + scanf(&quot;%lf&quot;, &amp;tensile_strength); + + // storing how many conditions are met as boolean result + int condition_met, condition1, condition2, condition3; + condition1 = hardness &gt; 50; + condition2 = carbon_content &lt; 0.7; + condition3 = tensile_strength &gt; 5600; + condition_met = condition1 + condition2 + condition3; + + // now grading according the result + int grade; + if (condition_met == 3) + grade = 10; + else if (condition_met == 2) + { + if (condition1 &amp;&amp; condition2) + grade = 9; + else if (condition2 &amp;&amp; condition3) + grade = 8; + else if (condition1 &amp;&amp; condition3) + grade = 7; + } + else if (condition_met == 1) + grade = 6; + else + grade = 5; + + // printing the result + printf(&quot;\n------------- Result -------------&quot;); + printf(&quot;\n1. Hardness : Condition %s&quot;, condition1 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); + printf(&quot;\n2. Carbon Content : Condition %s&quot;, condition2 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); + printf(&quot;\n3. Tensile Strength : Condition %s&quot;, condition3 ? &quot;MET&quot; : &quot;DID NOT MET&quot;); + printf(&quot;\nTotal Condition Met : %d&quot;, condition_met); + printf(&quot;\n\nGrade : %d\n\n&quot;, grade); + return 0; +} + +/* I did not used this long variable names. I used very short just the first letter of the word. +After writting the whole program, I just renamed the valiables. This is possible in Visual Stdio Code. */</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc022-c', 'luc022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc022.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc022.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc022-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* The Body Mass Index (BMI) is defined as ratio of weight of the +person (in Kilograms) to square of the height (in meters). +Write a program that receives weight and height, calculate the BMI, and reports +the BMI catagory as per the following table. + BMI Catagory BMI + Starvation &lt; 15 + Anorexic 15.1 to 17.5 + Underweight 17.6 to 18.5 + Ideal 18.6 to 24.9 + Overweight 25 to 25.9 + Obese 30 to 39.9 + Morbidly Obese &gt;= 40 +*/ +/* Author - Amit Dutta, Date - 4th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 72, Qn No.: D(d) */ + +#include &lt;stdio.h&gt; + +int main() +{ + double weight, height, bmi; + printf(&quot;Enter your Weight (in Kilograms) and Height (in Meters) : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;weight, &amp;height); + bmi = weight / (height * height); + printf(&quot;\nCalculated BMI : %g&quot;, bmi); + if (bmi &lt; 15) + printf(&quot;\nBMI Catagory : Starvation&quot;); + else if (bmi &gt;= 15.1 &amp;&amp; bmi &lt;= 17.5) + printf(&quot;\nBMI Catagory : Anorexic&quot;); + else if (bmi &gt;= 17.6 &amp;&amp; bmi &lt;= 18.5) + printf(&quot;\nBMI Catagory : Underweight&quot;); + else if (bmi &gt;= 18.6 &amp;&amp; bmi &lt;= 24.9) + printf(&quot;\nBMI Catagory : Ideal&quot;); + else if (bmi &gt;= 25 &amp;&amp; bmi &lt;= 25.9) + printf(&quot;\nBMI Catagory : Overweight&quot;); + else if (bmi &gt;= 30 &amp;&amp; bmi &lt;= 39.9) + printf(&quot;\nBMI Catagory : Obese&quot;); + else if (bmi &gt;= 40) + printf(&quot;\nBMI Catagory : Morbidly Obese&quot;); + else + printf(&quot;\nBMI Catagory : Unclassified&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc023-c', 'luc023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc023.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc023.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc023-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Using conditional operators determine : + (1) Whether the character entered through the keyboard is a + lower case alphabet or not. + (2) Whether a character entered through the keyboard is a special + symbol or not. */ +/* Author - Amit Dutta, Date - 5th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 72, Qn No.: E(a) */ + +#include &lt;stdio.h&gt; +int main() +{ + char inp; + printf(&quot;Enter the character : &quot;); + scanf(&quot;%c&quot;, &amp;inp); + printf(&quot;\nInput Character &#x27;%c&#x27; is %s a LOWER CASE ALPHABET.&quot;, inp, + (inp &gt;= &#x27;a&#x27; &amp;&amp; inp &lt;= &#x27;z&#x27;) ? &quot;&quot; : &quot;NOT&quot;); + printf(&quot;\nInput Character &#x27;%c&#x27; is %s a SPECIAL SYMBOL.&quot;, inp, + (inp &gt;= &#x27;a&#x27; &amp;&amp; inp &lt;= &#x27;z&#x27; || inp &gt;= &#x27;A&#x27; &amp;&amp; inp &lt;= &#x27;Z&#x27; + || inp &gt;= &#x27;0&#x27; &amp;&amp; inp &lt;= &#x27;9&#x27;) ? &quot;NOT&quot; : &quot;&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc024-c', 'luc024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc024.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc024.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc024-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program using conditional operators to determine whether +a year entered through the keyboard is a leap year or not. */ +/* Author - Amit Dutta, Date - 5th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 72, Qn No.: E(b) */ + +#include &lt;stdio.h&gt; +int main() +{ + int year; + printf(&quot;Enter the year : &quot;); + scanf(&quot;%d&quot;, &amp;year); + printf(&quot;\nYear %d is %s a Leapyear.&quot;, year, (year % 400 == 0 || year % 4 == 0 &amp;&amp; year % 100 != 0) ? &quot;&quot; : &quot;NOT&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc025-c', 'luc025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc025.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc025.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc025-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the greates of the three numbers entered +through the keyboard. Use conditional operators. */ +/* Author - Amit Dutta, Date - 6th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 72, Qn No.: E(c) */ + +#include &lt;stdio.h&gt; +int main() +{ + double num1, num2, num3, max; + printf(&quot;Enter three number : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;num1, &amp;num2, &amp;num3); + printf(&quot;\nGreatest of the three number &#x27;%g&#x27;, &#x27;%g&#x27; and &#x27;%g&#x27; is : &#x27;%g&#x27;&quot;, num1, num2, num3, + (num1 &gt; num2 &amp;&amp; num1 &gt; num3) ? num1 : ((num2 &gt; num1 &amp;&amp; num2 &gt; num3) ? num2 : num3)); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc026-c', 'luc026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc026.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc026.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc026-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to recieve value of an angle in degreesand check +whether sum of squares of sine and cosine of this angle is equal to 1. */ +/* Author - Amit Dutta, Date - 6th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 73, Qn No.: E(d) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#define EPSILON 0.0000001 + +int main() +{ + double angle, result; + printf(&quot;Enter the angle value in degree : &quot;); + // checking if the input is other than number. + if(scanf(&quot;%lf&quot;, &amp;angle) != 1) { + printf(&quot;\nPlease enter a number.&quot;); + return 1; + } + angle = angle * (M_PI / 180); // converting degree to radian + result = pow(sin(angle), 2) + pow(cos(angle), 2); + (fabs(result - 1.0) &lt; EPSILON) ? + printf(&quot;\nsum of squares of sine and cosine of this angle is equal to 1.&quot;) : + printf(&quot;\nsum of squares of sine and cosine of this angle is NOT equal to 1.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc027-c', 'luc027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc027.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc027.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc027-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Rewrite the folowing program using conditional operations + #include&lt;stdio.h&gt; + int main() + { + float sal; + printf(&quot;Enter the salary&quot;); + scanf(&quot;%f&quot;, &amp;sal); + if(sal &gt;= 25000 &amp;&amp; sal &lt;= 40000) + printf(&quot;Manager\n&quot;); + else + if(sal &gt;= 15000 &amp;&amp; sal &lt; 25000) + printf(&quot;Accountant\n&quot;); + else + printf(&quot;Clerk\n&quot;); + return 0; + } +*/ +/* Author - Amit Dutta, Date - 6th OCT, 2025 */ +/* Let Us C, Chap- 4, Page - 73, Qn No.: E(e) */ + +#include &lt;stdio.h&gt; +int main() +{ + float sal; + printf(&quot;Enter the salary&quot;); + scanf(&quot;%f&quot;, &amp;sal); + (sal &gt;= 25000 &amp;&amp; sal &lt;= 40000) ? printf(&quot;Manager\n&quot;) : + ((sal &gt;= 15000 &amp;&amp; sal &lt; 25000) ? printf(&quot;Accountant\n&quot;) : printf(&quot;Clerk\n&quot;)); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc028-c', 'luc028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc028.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc028.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc028-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print all the ASCII values and their equivalent +characters using a while loop. The ASCII may vary from 0 to 255. */ +/* Author - Amit Dutta, Date - 7th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(a) */ + +#include &lt;stdio.h&gt; +int main() +{ + int i = 0; + printf(&quot;ASCII Value\tCharacter&quot;); + printf(&quot;\n-----------\t---------\n&quot;); + while (i &lt;= 255) + { + printf(&quot;%d.\t%c\n\n&quot;, i, i); + i++; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc029-c', 'luc029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc029.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc029.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc029-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print out all Armstrong numbers between 100 +and 500. If sum of cubes of each digit of the number is equal to the +number itself, then the number is called an Armstrong number. For +example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3) */ +/* Author - Amit Dutta, Date - 7th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(b) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + int num = 100, temp1, temp2, res; + printf(&quot;Armstrong numbers between 100 and 500 :&quot;); + while (num &lt;= 500) + { + temp1 = num; + res = 0; + while (temp1 != 0) + { + temp2 = temp1 % 10; + res = res + pow(temp2, 3); + temp1 = temp1 / 10; + } + if (num == res) + printf(&quot; %d&quot;, num); + num++; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc030-c', 'luc030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc030.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc030.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc030-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program for a matchstick game being played between the +computer and a user. Your program should ensure that the computer +always wins. Rules for the game are as follows : + - There are 21 matchsticks. + - The computer asks the player to pick 1, 2, 3, or 4 matchsticks. + - After the person picks, the computer does its picking. + - Whoever is forced to pick up the last matchstick loses the game. +*/ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(c) */ + +/* My Plan: The total number of matchsticks is 21. To guarantee a win, +the computer ensures that after its turn, the number of remaining +matchsticks is always a multiple of 5 plus 1 (i.e., 16, 11, 6, 1). +This is achieved by making the sum of the player&#x27;s pick and the +computer&#x27;s pick equal to 5 in each round. This forces the player +to pick the final matchstick. */ + +#include &lt;stdio.h&gt; +int main() +{ + int remaining_matchsticks = 21, player_pick, computer_pick; + printf(&quot; --- Matchstick Game ---\n&quot;); + printf(&quot;Rules: There are 21 matchsticks. You can pick 1, 2, 3, or 4.\n&quot;); + printf(&quot;Whoever is forced to pick the last matchstick loses the game.\n&quot;); + while (remaining_matchsticks &gt; 1) + { + // game start + printf(&quot;\n--------------------------&quot;); + printf(&quot;\nRemaining Matchsticks : %d&quot;, remaining_matchsticks); + + // player pick and checking input is valid or not + printf(&quot;\nYour turn: Pick 1, 2, 3, or 4 matchsticks: &quot;); + if (scanf(&quot;%d&quot;, &amp;player_pick) != 1) + { + printf(&quot;\n\tPlease enter a number.&quot;); + while (getchar() != &#x27;\n&#x27;) + ; + continue; + } + + // checking player pick is valid or not + if (player_pick &lt; 1 || player_pick &gt; 4) + { + printf(&quot;\n\tPlease enter a number among 1, 2, 3 and 4.&quot;); + while (getchar() != &#x27;\n&#x27;) + ; + continue; + } + + if (player_pick &gt; remaining_matchsticks) + { + printf(&quot;\nInvalid choice! There are not enough matchsticks left.&quot;); + while (getchar() != &#x27;\n&#x27;) + ; + continue; + } + + // computer_picks + computer_pick = 5 - player_pick; + printf(&quot;\ncomputer_picks : %d&quot;, computer_pick); + + // remaining matchsticks + remaining_matchsticks = remaining_matchsticks - (player_pick + computer_pick); + } + + // game over + printf(&quot;\n----------------------------------\n&quot;); + printf(&quot;Only 1 matchstick is left.\n&quot;); + printf(&quot;You are forced to pick the last matchstick. You lose!\n&quot;); + printf(&quot;The computer wins.\n&quot;); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc031-logic-c', 'luc031-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031-logic.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc031-logic.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc031-logic-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to enter numbers till the user wants. At the end it +should display the count of positive, negative and zeros entered. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(d) */ + +/* + * DETAILED PROGRAM PLAN: + * 1. INITIALIZATION: Set three counters (positive_count, negative_count, zero_count) to zero. + * 2. INPUT LOOP: Start an infinite loop to continuously request user input. + * 3. READ INPUT: Use fgets() to read the user&#x27;s input as a generic string (char array). + * This allows the program to accept multi-digit numbers (e.g., &quot;-500&quot;) or the command (&#x27;n&#x27;). + * 4. TERMINATION CHECK: Immediately check if the input string is exactly &quot;n&quot; using strcmp(). + * If true, the user wants to quit, so break the loop. + * 5. VALIDATION &amp; CONVERSION: If the input is not &quot;n&quot;, use sscanf() to safely attempt to convert + * the string into an integer. + * 6. COUNTING LOGIC: If sscanf() successfully reads an integer (sscanf returns 1): + * - If the number is &gt; 0, increment positive_count. + * - If the number is &lt; 0, increment negative_count. + * - If the number is == 0, increment zero_count. + * 7. ERROR HANDLING: If the input is neither &quot;n&quot; nor a valid number (sscanf returns 0), + * inform the user of invalid input and continue the loop. + * 8. FINAL DISPLAY: After the loop terminates, print the final totals for positive, negative, and zero counts. + */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; // for strtol +#include &lt;string.h&gt; // for strcmp + +// Maximum size of the input line +#define MAX_INPUT_LEN 15 + +int main() { + // Initialize counters + int positive_count = 0; + int negative_count = 0; + int zero_count = 0; + + // Buffer to store the user&#x27;s input as a string (e.g., &quot;123&quot;, &quot;-50&quot;, or &quot;n&quot;) + char input_buffer[MAX_INPUT_LEN]; + int number; + + printf(&quot;--- Number Analyzer ---\n&quot;); + printf(&quot;Enter numbers one by one. Type &#x27;n&#x27; and press Enter to finish.\n\n&quot;); + + // Loop until the user enters &#x27;n&#x27; + while (1) { + printf(&quot;Enter number or &#x27;n&#x27;: &quot;); + + // Read the entire line of input into the buffer + if (fgets(input_buffer, MAX_INPUT_LEN, stdin) == NULL) { + // Handle EOF (end of file) or reading error + break; + } + + // Remove the trailing newline character from the input_buffer + // The last character will be &#x27;\n&#x27; if the input was shorter than MAX_INPUT_LEN + size_t len = strlen(input_buffer); + if (len &gt; 0 &amp;&amp; input_buffer[len - 1] == &#x27;\n&#x27;) { + input_buffer[len - 1] = &#x27;\0&#x27;; + } + + // 1. Check for the termination condition + if (strcmp(input_buffer, &quot;n&quot;) == 0) { + printf(&quot;\n&#x27;n&#x27; received. Stopping input...\n&quot;); + break; // Exit the while loop + } + + // 2. Attempt to convert the input string to an integer + // sscanf attempts to read the string according to the format &quot;%d&quot; (decimal integer) + // It returns 1 if a number was successfully read. + int conversions = sscanf(input_buffer, &quot;%d&quot;, &amp;number); + + if (conversions == 1) { + // Conversion was successful, now check the number&#x27;s sign + if (number &gt; 0) { + positive_count++; + } else if (number &lt; 0) { + negative_count++; + } else { + zero_count++; + } + printf(&quot; -&gt; Number recorded: %d\n&quot;, number); + } else { + // Conversion failed. The input was neither &#x27;n&#x27; nor a valid integer. + printf(&quot; -&gt; Invalid input. Please enter a valid number or &#x27;n&#x27;.\n&quot;); + } + } + + // Display the final results + printf(&quot;\n====================================\n&quot;); + printf(&quot; Analysis Complete\n&quot;); + printf(&quot;====================================\n&quot;); + printf(&quot;Positive numbers entered: %d\n&quot;, positive_count); + printf(&quot;Negative numbers entered: %d\n&quot;, negative_count); + printf(&quot;Zeroes entered: %d\n&quot;, zero_count); + printf(&quot;Total numbers recorded: %d\n&quot;, positive_count + negative_count + zero_count); + printf(&quot;====================================\n&quot;); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc031-c', 'luc031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc031.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc031-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to enter numbers till the user wants. At the end it +should display the count of positive, negative and zeros entered. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(d) */ + +#include &lt;stdio.h&gt; +int main() +{ + int choice = 1, num, positive_count = 0, negative_count = 0, zero_count = 0; + while (choice == 1) + { + printf(&quot;\nEnter the number (Type any character and press Enter to finish.) : &quot;); + choice = scanf(&quot;%d&quot;, &amp;num); // Checking whether the user has input any characters + if (choice == 1) + { + printf(&quot;Number recorded : %d&quot;, num); + if (num &lt; 0) + negative_count++; + else if (num &gt; 0) + positive_count++; + else if (num == 0) + zero_count++; + } + else + { + // If the user inputs any characters, then choice = 0, it means he doesn&#x27;t want to give any more input; + choice = 0; + printf(&quot;\nCharacter received. Stopping input...\n&quot;); + } + } + // Display the final results + printf(&quot;\n====================================\n&quot;); + printf(&quot; Analysis Complete\n&quot;); + printf(&quot;====================================\n&quot;); + printf(&quot;Positive numbers entered: %d\n&quot;, positive_count); + printf(&quot;Negative numbers entered: %d\n&quot;, negative_count); + printf(&quot;Zeroes entered: %d\n&quot;, zero_count); + printf(&quot;Total numbers recorded: %d\n&quot;, positive_count + negative_count + zero_count); + printf(&quot;====================================\n&quot;); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc032-c', 'luc032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc032.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc032.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc032-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to recieve an integer and find its octal equivalent. +(Hint : To obtain octal equivalent of an integer, Divide it continuously +by 8 till dividend does not become zero, then write the remainders +obtained in reverse derection.) */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(e) */ + +// using array + +#include &lt;stdio.h&gt; +int main() +{ + int octal[20], decimal, index = 0, temp, rem; + printf(&quot;Enter the decimal number : &quot;); + scanf(&quot;%d&quot;, &amp;decimal); + temp = decimal; + while (temp != 0) + { + rem = temp % 8; + temp = temp / 8; + octal[index] = rem; + index++; + } + printf(&quot;\nDeciaml %d to octal : &quot;, decimal); + while ((index - 1) &gt;= 0) + { + printf(&quot;%d&quot;, octal[index - 1]); + index--; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc033-c', 'luc033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc033.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc033.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc033-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the range of a set of numbers entered +through the keyboard. Range is the difference between the smallest +and biggest number in the list. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(f) */ + +#include &lt;stdio.h&gt; +int main() +{ + int choice = 1, set_of_numbers[30], num, index = -1; + while (choice == 1) + { + printf(&quot;\nEnter the number (Type any character and press Enter to finish.) : &quot;); + choice = scanf(&quot;%d&quot;, &amp;num); // Checking whether the user has input any characters + if (choice != 1) + { + // If the user inputs any characters, then choice = 0, it means he doesn&#x27;t want to give any more input; + choice = 0; + printf(&quot;\nCharacter received. Stopping input...\n&quot;); + break; + } + index++; + set_of_numbers[index] = num; + } + int max = set_of_numbers[0], min = set_of_numbers[0]; + while (index &gt;= 0) + { + if (max &lt; set_of_numbers[index]) + max = set_of_numbers[index]; + if (min &gt; set_of_numbers[index]) + min = set_of_numbers[index]; + index--; + } + int range = max - min; + printf(&quot;\nBiggest number in the set : %d&quot;, max); + printf(&quot;\nSmallest number in the set : %d&quot;, min); + printf(&quot;\nRange : %d&quot;, range); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc034-c', 'luc034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc034.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc034.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc034-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print the multiplication table of the number +entered by the user. The table should get displayed in the following +form : + 29 * 1 = 29 + 29 * 2 = 58 +*/ +/* Author - Amit Dutta, Date - 20th OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 105, Qn No.: B(a) */ + +#include &lt;stdio.h&gt; +int main() +{ + int i, num, res; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + printf(&quot;\n--- Multiplication Table ---\n&quot;); + for (i = 1; i &lt;= 10; i++) + printf(&quot;%d * %d = %d\n&quot;, num, i, num * i); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc035-c', 'luc035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc035.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc035.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc035-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* According to a study, the approximate level of intelligence of a +person can be calculated using the following formula. + i = 2 + (y + 0.5x) +write a program that will produce a table of values of i, y and x, +where y varies from 1 to 6, and, for each value of y, x varies from +5.5 to 12.5 in steps of 0.5 */ +/* Author - Amit Dutta, Date - 20th OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 105, Qn No.: B(b) */ + +#include &lt;stdio.h&gt; +int main() +{ + double y, x; + printf(&quot;\n--- Approximate Intelligence ---\n&quot;); + for (y = 1; y &lt;= 6; y++) + { + printf(&quot;\tY = %d\n&quot;, y); + for (x = 5.5; x &lt;= 12.5; x += 0.5) + { + printf(&quot;Y: %g\t X: %.2g\t I: %g\n&quot;, y, x, 2 + (y + 0.5 * x)); + } + printf(&quot;-----------------------\n&quot;); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc036-c', 'luc036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc036.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc036.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc036-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* When interest compounds q times per year at an annual rate of +r % for n years, the principle p compounds to an amount a as per +the following formula + a = p (1 + r / q) ^ nq +Write a program to read 10 sets of p, r, n &amp; q and calculate the +corresponding as&#x27; */ +/* Author - Amit Dutta, Date - 20th OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(c) */ + +// DEVELOPMENT STATUS: This implementation is currently untested. +// Please report any functional defects or errors by submitting a GitHub issue &quot;https://github.com/notamitgamer/bsc/issues&quot; with the updated code. + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double interest, principalAmount, interestRate, timeInYears, compoundFactor, totalAmount; + int index; + for (index = 1; index &lt;= 10; index++) + { + printf(&quot;Enter Principle amount : &quot;); + scanf(&quot;%lf&quot;, &amp;principalAmount); + printf(&quot;Enter Rate of Interest : &quot;); + scanf(&quot;%lf&quot;, &amp;interestRate); + interestRate *= 0.01; + printf(&quot;Enter the Time (Years) : &quot;); + scanf(&quot;%lf&quot;, &amp;timeInYears); + printf(&quot;Compound count in one year : &quot;); + scanf(&quot;%lf&quot;, &amp;compoundFactor); + totalAmount = (principalAmount * pow((1 + interestRate / compoundFactor), (timeInYears * compoundFactor))); + interest = totalAmount - principalAmount; + printf(&quot;\nInterest : %.2f\nTotal Amount : %.2f\n\n&quot;, interest, totalAmount); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc037-c', 'luc037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc037.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc037.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc037-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* The natural logarithm can be approximated by the following series. + (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 - 21st OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(d) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +double series(double x) // made this fn only for fun, making a fn was not necessary +{ + double result = (x - 1) / x; + int i; + for (i = 2; i &lt;= 7; i++) + { + result += 0.5 * pow(((x - 1) / x), i); + } + return result; +} + +int main() +{ + double x; + printf(&quot;Enter the value for x : &quot;); + scanf(&quot;%lf&quot;, &amp;x); + printf(&quot;\nResult : %g&quot;, series(x)); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc038-c', 'luc038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc038.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc038.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc038-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to generate all Pythagorean Triplets with slide +length less than or equal to 30. */ +/* Author - Amit Dutta, Date - 21st OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(e) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + int a, b, c; + printf(&quot;Pythagorean Triplets with slide length less than or equal to 30 : \n&quot;); + for (a = 1; a &lt;= 30; a++) + { + for (b = a; b &lt;= 30; b++) + { + int c_square = a * a + b * b; + for (c = b + 1; c &lt;= 30; c++) + { + if (c * c == c_square) + printf(&quot;(%d, %d, %d)\n&quot;, a, b, c); + } + } + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc039-c', 'luc039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc039.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc039.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc039-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Population of a town today is 100000. The population has increased +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 - 21st OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(f) */ + +#include &lt;stdio.h&gt; +int main() +{ + int i, population = 100000; + printf(&quot;Present year : %d\n&quot;, population); + for (i = 1; i &lt;= 10; i++) + { + population /= 1.10; + printf(&quot;%d year ago : %d\n&quot;, i, population); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc040-logic-c', 'luc040-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040-logic.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc040-logic.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040-logic.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc040-logic-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Ramanujan number (1729) is the smallest number that can be +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 - 22nd - 23rd OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ + +// 1. INCLUDE SECTION +#include &lt;stdio.h&gt; // Includes the standard input/output library, necessary for printf() + +// 2. CONSTANT DEFINITIONS (MACROS) +// These define fixed values we can easily use and change later. +#define LIMIT 100000 // The maximum number we want to search up to. +// The maximum base value (a, b, c, or d) we need to check. +// Since 47^3 is greater than 100,000, checking bases up to 47 covers the LIMIT. +#define MAX_BASE_VAL 47 + +// 3. MAIN FUNCTION +int main() +{ + // 4. VARIABLE DECLARATION + + // sum1 and sum2 store the results of a^3 + b^3 and c^3 + d^3. + // We use &#x27;long long&#x27; because cubes (like 47^3) are large and can exceed + // the capacity of a standard &#x27;int&#x27;, preventing errors. + long long sum1, sum2; + + int count = 0; // Counter to keep track of how many Ramanujan numbers we find. + + // This flag is used to optimize the search. If we find the second way (c^3 + d^3) + // to make sum1, we set this to 1 and immediately stop the inner loops. + int found_match; + + // Print introductory message to the user. + printf(&quot;Ramanujan Number Finder (a^3 + b^3 = c^3 + d^3)\n&quot;); + printf(&quot;Searching up to %d (Max base value is %d)\n&quot;, LIMIT, MAX_BASE_VAL); + printf(&quot;---------------------------------------------------\n&quot;); + + // 5. OUTER LOOPS: Establishing the FIRST SUM (a^3 + b^3 = sum1) + + // Loop for &#x27;a&#x27; (the smaller base of the first pair) + for (int a = 1; a &lt;= MAX_BASE_VAL; a++) + { + + // Loop for &#x27;b&#x27; (the larger base of the first pair) + // We start &#x27;b&#x27; at &#x27;a + 1&#x27; to enforce the rule a &lt; b. + // This prevents us from checking redundant pairs like (1, 12) and (12, 1). + for (int b = a + 1; b &lt;= MAX_BASE_VAL; b++) + { + + // Calculate the first sum: sum1 = a^3 + b^3 + // (long long) is a cast to ensure the math is done using the &#x27;long long&#x27; type. + sum1 = (long long)a * a * a + (long long)b * b * b; + + // Optimization 1: Check if the sum exceeds the global limit. + if (sum1 &gt; LIMIT) + { + // Since &#x27;b&#x27; is increasing, any further increase will also be over the limit. + // We stop the &#x27;b&#x27; loop and move to the next &#x27;a&#x27;. + break; + } + + // Reset the flag for every new sum1. + // We start searching for a second way for this new &#x27;sum1&#x27;, so we reset the flag to 0. + found_match = 0; + + // 6. INNER LOOPS: Searching for the SECOND SUM (c^3 + d^3 = sum2) + + // Loop for &#x27;c&#x27; (the smaller base of the second pair) + // We start &#x27;c&#x27; at &#x27;a + 1&#x27; to enforce the rule a &lt; c. + // This ensures the two pairs {(a, b) and (c, d)} are truly distinct (e.g., 1729 = 1^3 + 12^3 and 9^3 + 10^3). + for (int c = a + 1; c &lt;= MAX_BASE_VAL; c++) + { + + // Optimization 2: Check the flag to exit the &#x27;c&#x27; loop early. + if (found_match) + { + // If we already found the second way (c, d) in a previous iteration of &#x27;c&#x27;, stop searching and move to the next (a, b) pair. + break; + } + + // Loop for &#x27;d&#x27; (the larger base of the second pair) + // We start &#x27;d&#x27; at &#x27;c + 1&#x27; to enforce c &lt; d. + for (int d = c + 1; d &lt;= MAX_BASE_VAL; d++) + { + + // Calculate the second sum: sum2 = c^3 + d^3 + sum2 = (long long)c * c * c + (long long)d * d * d; + + // Optimization 3: Check if the second sum has passed the first sum. + if (sum2 &gt; sum1) + { + // Since &#x27;d&#x27; is increasing, any further increase will also be greater than sum1. + // We stop the &#x27;d&#x27; loop and move to the next &#x27;c&#x27;. + break; + } + + // 7. CONDITION CHECK: Have we found a Ramanujan number? + // Check if the two sums are equal. + if (sum1 == sum2) + { + count++; // Increment the counter + + // Print the result in the required format. + printf(&quot;[%d] %lld = %d^3 + %d^3 = %d^3 + %d^3\n&quot;, + count, sum1, a, b, c, d); + + // Set the flag to 1, confirming we found the second way. + found_match = 1; + + // Stop the &#x27;d&#x27; loop immediately, as we found the required second pair. + break; + } + } + // If found_match was set to 1, the &#x27;break&#x27; in the d loop will execute, + // then the &#x27;if (found_match) break;&#x27; in the c loop will execute, + // and the program will move to the next (a, b) pair. + } + } + } + + // 8. CONCLUSION + printf(&quot;---------------------------------------------------\n&quot;); + printf(&quot;Search complete. Found %d Ramanujan-type numbers.\n&quot;, count); + + return 0; // Standard way to indicate successful program execution. +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc040-c', 'luc040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc040.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc040-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Ramanujan number (1729) is the smallest number that can be +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 - 22nd - 23rd OCT, 2025 */ +/* Let Us C, Chap- 6, Page - 106, Qn No.: B(g) */ + +#include &lt;stdio.h&gt; + +#define limit 100000 +#define max_base 47 + +int main() +{ + + long long sum1, sum2; + int count = 0; + + printf(&quot;Ramanujan numbers : \n&quot;); + + int found_match; + + for (int a = 1; a &lt;= max_base; a++) + { + for (int b = a + 1; b &lt;= max_base; b++) + { + sum1 = (long long)a * a * a + (long long)b * b * b; + if (sum1 &gt; limit) + { + break; + } + + found_match = 0; + + for (int c = a + 1; c &lt;= max_base; c++) + { + if (found_match) + { + break; + } + for (int d = c + 1; d &lt;= max_base; d++) + { + sum2 = (long long)c * c * c + (long long)d * d * d; + if (sum2 &gt; sum1) + { + break; + } + if (sum1 == sum2) + { + count++; + printf(&quot;(%d.) %lld = %d^3 + %d^3 = %d^3 + %d^3\n&quot;, count, sum1, a, b, c, d); + + found_match = 1; + break; + } + } + } + } + } + + printf(&quot;-------------------------------\n&quot;); + printf(&quot;Search complete.&quot;); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc041-c', 'luc041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc041.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc041.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc041-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc042-c', 'luc042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc042.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc042.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc042-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc043-c', 'luc043.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc043.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc043.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc043.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc043-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the grace marks for a student using switch. +The user should enter the class obtained by the student and the +number of subjects he has failed in. Use the following logic. + - If the student gets first class and he fails in more than 3 + subjects, he does not get any grace, Otherwise, he gets a grace + of 5 marks per subject. + - If the student gets second class and he fails in more than 2 + subjects, he does not get any grace. Otherwise, he gets a grace + of 4 marks per subject. + - If the student gets third class and he fails in more than 1 + subject, then he does not get any grace. Otherwise, he gets a + grace of 5 marks. +*/ +/* Author - Amit Dutta, Date - 28th OCT, 2025 */ +/* Let Us C, Chap- 7, Page - 125, Qn No.: C */ + +#include &lt;stdio.h&gt; + +int main() +{ + int studentClass, failedSubjectCount, graceMarks = 0; + printf(&quot;Class obtained by the student (Enter 1 for First Class, 2 for Second Class, 3 for Third Class): &quot;); + scanf(&quot;%d&quot;, &amp;studentClass); + printf(&quot;Failed Subject Count: &quot;); + scanf(&quot;%d&quot;, &amp;failedSubjectCount); + + if (failedSubjectCount &lt; 0) { + printf(&quot;\nFailed subject count cannot be negative.&quot;); + return 1; + } + + switch (studentClass) + { + case 1: + if (failedSubjectCount &lt;= 3) + { + graceMarks += 5 * failedSubjectCount; + } + break; + + case 2: + if (failedSubjectCount &lt;= 2) + { + graceMarks += 4 * failedSubjectCount; + } + break; + + case 3: + if (failedSubjectCount &lt;= 1) + { + graceMarks += 5 * failedSubjectCount; + } + break; + + default: + printf(&quot;\nWrong Choice.&quot;); + return 1; + } + + printf(&quot;\nStudent will get %d grace marks.&quot;, graceMarks); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc044-c', 'luc044.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc044.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc044.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc044.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc044-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Any year is entered through the keyboard. Write a function to +determine whether the year is aleap year or not. */ +/* Author - Amit Dutta, Date - 17th November, 2025 */ +/* Let Us C, Chap- 8, Page - 144, Qn No.: C(1) */ + +#include &lt;stdio.h&gt; + +int leapYear(int); + +int leapYear(int year) +{ + if ((year % 400 == 0) || ((year % 4 == 0) &amp;&amp; (year % 100 != 0))) + return 1; + else + return 0; +} + +int main() +{ + int year; + printf(&quot;Enter the year : &quot;); + scanf(&quot;%d&quot;, &amp;year); + if (leapYear(year)) + printf(&quot;\nYear %d is a Leap Year.&quot;, year); + else + printf(&quot;\nYear %d is not a Leap Year.&quot;, year); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc045-c', 'luc045.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc045.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc045.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc045.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc045-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* A position integer is entered through the keyboard. Write a Function +to obtain the prime factors of this number. +For example, prime factors of 24 are 2, 2, 2 and 3, whereas prime +factors of 35 are 5 and 7 +*/ +/* Author - Amit Dutta, Date - 17th November, 2025 */ +/* Let Us C, Chap- 8, Page - 144, Qn No.: C(2) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +void findPrimeFactors(int n) +{ + int temp_n = n; + + if (temp_n == 1) + { + printf(&quot;Prime factors of %d are: None.\n&quot;, n); + return; + } + + printf(&quot;Prime factors of %d are:&quot;, n); + + while (temp_n % 2 == 0) + { + printf(&quot; %d&quot;, 2); + temp_n = temp_n / 2; + } + + for (int i = 3; i &lt;= (int)sqrt(temp_n); i = i + 2) + { + while (temp_n % i == 0) + { + printf(&quot; %d&quot;, i); + temp_n = temp_n / i; + } + } + + if (temp_n &gt; 2) + { + printf(&quot; %d&quot;, temp_n); + } + + printf(&quot;\n&quot;); +} + +int main() +{ + int n; + printf(&quot;Enter a positive integer to get the prime factors: &quot;); + if (scanf(&quot;%d&quot;, &amp;n) != 1) + { + printf(&quot;Error: Invalid input. Please enter an integer.\n&quot;); + return 1; + } + if (n &lt;= 0) + { + printf(&quot;Error: Please enter a POSITIVE integer.\n&quot;); + return 1; + } + findPrimeFactors(n); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc046-c', 'luc046.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc046.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc046.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc046.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc046-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Given three variables x, y, z, write a function to circularly shift their +values to right. In other words, if x = 5, y = 8, z = 10, after circular +shift y = 5, z = 8, x = 10. cal the function with variables a, b, c to +circularly shift values. +*/ +/* Author - Amit Dutta, Date - 24th November, 2025 */ +/* Let Us C, Chap- 9, Page - 163, Qn No.: C(a) */ + +#include &lt;stdio.h&gt; + +void circularShift(int *, int *, int *); + +int main() +{ + int x = 5, y = 8, z = 10; + + printf(&quot;--- Before Shift ---\n&quot;); + printf(&quot;x: %d, y: %d, z: %d&quot;, x, y, z); + + circularShift(&amp;x, &amp;y, &amp;z); + + printf(&quot;\n--- After Shift ---\n&quot;); + printf(&quot;x: %d, y: %d, z: %d&quot;, x, y, z); + + return 0; +} + +void circularShift(int *x, int *y, int *z) +{ + int temp = *z; + *z = *y; + *y = *x; + *x = temp; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc047-c', 'luc047.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc047.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc047.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc047.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc047-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Define a function that receives weight of a commodity in kilograms +and returns the equivalent weight in Grams, Tons and pounds. Call +this fuction from main() and print the results in main() +*/ +/* Author - Amit Dutta, Date - 24th November, 2025 */ +/* Let Us C, Chap- 9, Page - 163, Qn No.: C(b) */ + +#include &lt;stdio.h&gt; + +void convertWeight(double, double *, double *, double *); + +int main() +{ + double weightGram, weightPound, weightKG, weightTON; + printf(&quot;Enter the weight of the comodity in Kilogram(s): &quot;); + scanf(&quot;%lf&quot;, &amp;weightKG); + + convertWeight(weightKG, &amp;weightGram, &amp;weightPound, &amp;weightTON); + printf(&quot;\n%g Kilogram(s) = %.04f Gram(s)&quot; + &quot;\n%g Kilogram(s) = %.04f Pound(s)&quot; + &quot;\n%g Kilogram(s) = %.04f TON(s)&quot;, + weightKG, weightGram, weightKG, weightPound, weightKG, weightTON); + return 0; +} + +void convertWeight(double weightKG, double *weightGram, double *weightPound, double *weightTON) +{ + *weightGram = weightKG * 1000.0; + *weightPound = weightKG * 2.2046226218; + *weightTON = weightKG / 1000.0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc048-c', 'luc048.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc048.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc048.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc048.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-luc048-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Define a function to compute the distance between two points and +use it to develop another function that will compute the area of the +triangle whose vertices are A(x1, y1), B(x2, y2), and C(x3, y3). Use +these functions to develop a function which returns a value 1 if the +point (x, y) lines inside the triangle ABC, otherwise returns a value +0. Would you get any advantage if you develop these functions to +work on call by reference principle? +*/ +/* Author - Amit Dutta, Date - 25th November, 2025 */ +/* Let Us C, Chap- 9 (Pointers), Page - 163, Qn No.: C(c) */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;ctype.h&gt; +#include &lt;stdlib.h&gt; + +void distance(double, double, double, double, double *); +void area(double, double, double, double, double, double, double *); +int is_inside(double, double, double, double, double, double, double, double); + +int main() +{ + + // Variables + double x, y, x1, x2, y1, y2, x3, y3, result_Distance, result_Area; + char choice; + + /* ********** Requirement: 1 ********** */ + + // Calculate the length of the line segment between two points, P1(x1, y1) and P2(x2, y2). + // Function Used: distance() + + printf(&quot;--- Compute the distance between two points ---\n\n&quot;); + printf(&quot;Enter the co-ordinates of Point 1 (Ex.: 5,6): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); + printf(&quot;Enter the co-ordinates of Point 2 (Ex.: 3,4): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); + + distance(x1, y1, x2, y2, &amp;result_Distance); + printf(&quot;\nDistance between P1(%g, %g) and P2(%g, %g) = %g&quot;, + x1, y1, x2, y2, result_Distance); + + /* ********** Requirement: 2 ********** */ + + // Calculate the area of a triangle ABC using its three vertices A(x1, y1), B(x2, y2), and C(x3, y3). + // Fuction Used: distance(), area() + + printf(&quot;\n\n--- Compute the area of a triangle ABC ---\n\n&quot;); + printf(&quot;Enter the co-ordinates of Point A (Ex.: 5,6): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); + printf(&quot;Enter the co-ordinates of Point B (Ex.: 3,4): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); + printf(&quot;Enter the co-ordinates of Point C (Ex.: 6,7): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x3, &amp;y3); + + area(x1, y1, x2, y2, x3, y3, &amp;result_Area); + printf(&quot;\nArea of the A(%g, %g), B(%g, %g), C(%g, %g) = %g&quot;, + x1, y1, x2, y2, x3, y3, result_Area); + + /* ********** Requirement: 3 ********** */ + + // Check if a test point P(x, y) lies strictly inside the triangle ABC. + // Function Used: distance(), area(), is_inside() + + printf(&quot;\n\n--- Check if a test point P(x, y) lies strictly inside the triangle ABC ---\n\n&quot;); + printf(&quot;Do you wish to use previous entered triangle?&quot; + &quot;\nIf Yes, type &#x27;Y&#x27;; If No, type &#x27;N&#x27;: &quot;); + scanf(&quot; %c&quot;, &amp;choice); + choice = toupper(choice); + switch (choice) + { + case &#x27;Y&#x27;: + break; + case &#x27;N&#x27;: + printf(&quot;Enter the co-ordinates of Point A (Ex.: 5,6): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x1, &amp;y1); + printf(&quot;Enter the co-ordinates of Point B (Ex.: 3,4): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x2, &amp;y2); + printf(&quot;Enter the co-ordinates of Point C (Ex.: 6,7): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x3, &amp;y3); + break; + default: + printf(&quot;\nYou entered invalid choice.&quot;); + break; + } + printf(&quot;Enter the co-ordinates of Test Point (Ex.: 3,5): &quot;); + scanf(&quot;%lf,%lf&quot;, &amp;x, &amp;y); + + if (is_inside(x, y, x1, y1, x2, y2, x3, y3)) + printf(&quot;\nTest Point (%g, %g) is inside ABC.&quot;, x, y); + else + printf(&quot;\nTest Point (%g, %g) is not inside ABC.&quot;, x, y); + + /* ANSWER TO THE QUESTION: + Qn.: + Would you get any advantage if you develop these functions to + work on call by reference principle? + + Ans: + NO, there is no advantage, and moreover, that would be a disadvantage. + It introduces unnecessary dereferencing overhead for every operation, + Which is less efficient than reading the simple value copy supplied by Call by Value. + */ + + // End of Program + return 0; +} + +void distance(double x1, double y1, double x2, double y2, double *result_Distance) +{ + *result_Distance = sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2)); +} + +void area(double x1, double y1, double x2, double y2, double x3, double y3, double *result_Area) +{ + double s, ab, bc, ac; + + distance(x1, y1, x2, y2, &amp;ab); + distance(x2, y2, x3, y3, &amp;bc); + distance(x1, y1, x3, y3, &amp;ac); + + s = (ab + bc + ac) / 2.0; + double area_sq = s * (s - ab) * (s - bc) * (s - ac); + + if (area_sq &lt; 0) + // Handle cases where area_sq is slightly negative due to floating-point errors + *result_Area = 0.0; + else + *result_Area = sqrt(area_sq); +} + +int is_inside(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3) +{ + double area_ABC, area_PAB, area_PBC, area_PAC; + + const double EPSILON = 0.000001; + + area(x1, y1, x2, y2, x3, y3, &amp;area_ABC); + area(x, y, x1, y1, x2, y2, &amp;area_PAB); + area(x, y, x2, y2, x3, y3, &amp;area_PBC); + area(x, y, x1, y1, x3, y3, &amp;area_PAC); + + double sum_of_sub_areas = area_PAB + area_PBC + area_PAC; + + if (fabs(area_ABC - sum_of_sub_areas) &lt; EPSILON) + return 1; + else + return 0; +} + +/* + *************** SAMPLE OUTPUT *************** + +PS G:\bsc\letusc&gt; ./*.exe +--- Compute the distance between two points --- + +Enter the co-ordinates of Point 1 (Ex.: 5,6): 1234.56,7890.12 +Enter the co-ordinates of Point 2 (Ex.: 3,4): 1234.56,7891.12 + +Distance between P1(1234.56, 7890.12) and P2(1234.56, 7891.12) = 1 + +--- Compute the area of a triangle ABC --- + +Enter the co-ordinates of Point A (Ex.: 5,6): 100.10,200.20 +Enter the co-ordinates of Point B (Ex.: 3,4): 105.10,200.20 +Enter the co-ordinates of Point C (Ex.: 6,7): 100.10,205.20 + +Area of the A(100.1, 200.2), B(105.1, 200.2), C(100.1, 205.2) = 12.5 + +--- Check if a test point P(x, y) lies strictly inside the triangle ABC --- + +Do you wish to use previous entered triangle? +If Yes, type &#x27;Y&#x27;; If No, type &#x27;N&#x27;: y +Enter the co-ordinates of Test Point (Ex.: 3,5): 101.10,201.20 + +Test Point (101.1, 201.2) is inside ABC. + +*/</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem001-c', 'lucproblem001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Consider a currency system in which there are notes of six denominations, +namely, Rs. 1, Rs. 2, rs. 5, Rs. 10, Rs. 50, Rs. 100. If a sum +of Rs. N is entered through the keyboard, Write a program to compute +the smallest number of notes that will combine to give Rs. N. */ +/* Author - Amit Dutta, Date - 29th SEP, 2025 */ +/* Let Us C, Chap - 2, Page - 22, Problem 2.3 */ + +#include &lt;stdio.h&gt; +int main() +{ + int n, nonotes, temp; + printf(&quot;Enter the amount : &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (n &lt; 1) + { + printf(&quot;\nAmount should be a positive integer.&quot;); + return 1; + } + temp = n; + nonotes = n / 100; + n = n % 100; + nonotes = nonotes + (n / 50); + n = n % 50; + nonotes = nonotes + (n / 10); + n = n % 10; + nonotes = nonotes + (n / 5); + n = n % 5; + nonotes = nonotes + (n / 2); + n = n % 2; + nonotes = nonotes + n; + printf(&quot;\nthe smallest number of notes that will combine to give Rs. %d : %d&quot;, temp, nonotes); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem002-c', 'lucproblem002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* A year is entered through the keyboard, write a program to +determine whether the year is leap or not. Use the logical operators +&amp;&amp; and || . */ +/* Author - Amit Dutta, Date - 02th OCT, 2025 */ +/* Let Us C, Chap - 4, Page - 64, Problem 4.1 */ + +#include &lt;stdio.h&gt; +int main() +{ + int year; + printf(&quot;Enter year : &quot;); + scanf(&quot;%d&quot;, &amp;year); + if (year % 4 == 0 &amp;&amp; year &amp; 100 != 0 || year % 400 == 0) + printf(&quot;\nYear %d is a leapyear.&quot;, year); + else + printf(&quot;\nYear %d is not a leapyear.&quot;, year); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem003-c', 'lucproblem003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* If a character is entered through the keyboard, Write a program +to determine whether the character is a capital letter, a small case letter, +a digit or a speacial symbol. +The following table shows the range of ASCII values for various characters : + Characters ASCII Values + A - Z 65 - 90 + a - z 97 - 122 + 0 - 9 48 - 57 + special symbols 0 - 47, 58 - 64, 91 - 96, 123 - 127 +*/ +/* Author - Amit Dutta, Date - 02th OCT, 2025 */ +/* Let Us C, Chap - 4, Page - 65, Problem 4.2 */ + +#include &lt;stdio.h&gt; +int main() +{ + char inp; + printf(&quot;Enter one character : &quot;); + scanf(&quot; %c&quot;, &amp;inp); + if (inp &gt;= 64 &amp;&amp; inp &lt;= 90) + printf(&quot;\nInput &#x27;%c&#x27; is a CAPITAL LETTER.&quot;, inp); + if (inp &gt;= 97 &amp;&amp; inp &lt;= 122) + printf(&quot;\nInput &#x27;%c&#x27; is a SMALL CASE LETTER.&quot;, inp); + if (inp &gt;= 48 &amp;&amp; inp &lt;= 57) + printf(&quot;\nInput &#x27;%c&#x27; is a DIGIT.&quot;, inp); + if (inp &gt;= 0 &amp;&amp; inp &lt;= 47 || inp &gt;= 58 &amp;&amp; inp &lt;= 64 + || inp &gt;= 91 &amp;&amp; inp &lt;= 96 || inp &gt;= 123 &amp;&amp; inp &lt;= 127) + printf(&quot;\nInput &#x27;%c&#x27; is a SPECIAL SYMBOL.&quot;, inp); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem004-c', 'lucproblem004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* If the lengths of three sides of a triangle are entered through the +keyboard, write a program to check whether the triangle is valid or not. +The triangle is valid if the sum of two sides is greater that the largest +of the three sides. */ +/* Author - Amit Dutta, Date - 02th OCT, 2025 */ +/* Let Us C, Chap - 4, Page - 66, Problem 4.3 */ + +#include &lt;stdio.h&gt; +int main() +{ + double side1, side2, side3; + printf(&quot;Enter the length of side1, side2 and side3 of the triangle : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;side1, &amp;side2, &amp;side3); + if (side1 &lt;= 0 || side2 &lt;= 0 || side3 &lt;= 0) + { + printf(&quot;\nTriangle sides must be positive.\n&quot;); + return 1; + } + if ((side1 + side2 &gt; side3) &amp;&amp; (side1 + side3 &gt; side2) &amp;&amp; (side2 + side3 &gt; side1)) + // Triangle Inequality Theorem + printf(&quot;\nThis triangle is valid.&quot;); + else + printf(&quot;\nThis triangle is not valid.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem005-c', 'lucproblem005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to calculate overtime pay of 10 employees. Overtime is +paid at the rate of Rs. 120.00 per hour for every hour worked above 40 +hours. Assume that employees do not work for fractional part of an hour. */ +/* ONLY WHILE LOOP ALLOWED */ +/* Author - Amit Dutta, Date - 07th OCT, 2025 */ +/* Let Us C, Chap - 5, Page - 83, Problem 5.1 */ + +#include &lt;stdio.h&gt; +#include &lt;conio.h&gt; +int main() +{ + int working_hour, i = 1; + double pay; + while (i &lt;= 10) + { + printf(&quot;Enter the working hour for the employee no. %d : &quot;, i); + if (scanf(&quot;%d&quot;, &amp;working_hour) != 1) + { + printf(&quot;\n\tPlease enter a number as woking hour.\n\n&quot;); + while (getchar() != &#x27;\n&#x27;) + ; + // above line discard the input characters untill getchar() reaches the new line character. + /* if I do not discard the input, after &#x27;continue;&#x27; statement that input will be again taken + by scanf (In the line 17). It will be a infinite loop of error. */ + continue; + } + // checking overtime + if (working_hour &gt; 40) + { + pay = (working_hour - 40) * 120.00; + printf(&quot;\n\tOvertime working hours of Employee %d : %d&quot;, i, (working_hour - 40)); + printf(&quot;\n\tPay of the overtime for Employee %d : Rs. %.2f\n\n&quot;, i, pay); + } + else + printf(&quot;\n\tEmployee %d did not work any overtime.\n\n&quot;, i); + i++; // changing to next employee + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem006-c', 'lucproblem006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the factorial value of any number entered +through the keyboard. */ +/* Author - Amit Dutta, Date - 07th OCT, 2025 */ +/* Let Us C, Chap - 5, Page - 84, Problem 5.2 */ + +#include &lt;stdio.h&gt; +int main() +{ + int num, i = 1; + long long fact = 1; + printf(&quot;Enter the number : &quot;); + // checking if the input is valid or not + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + return 1; + } + // result for the negetive input + if (num &lt; 0) + { + printf(&quot;\nFactorial of %d : Undefined&quot;, num); + return 1; + } + // Hard codded result for input &#x27;0&#x27; (zero) + if (num == 0) + { + printf(&quot;\nFactorial of 0 : 1&quot;); + return 0; + } + // calculating result + while (i &lt;= num) { + fact = fact * i; + i++; + } + printf(&quot;\nFactorial of %d : %d&quot;, num, fact); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem007-c', 'lucproblem007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Two numbers are entered through the keyboard. Write a program to +find the value of one number raised to the power of another */ +/* Author - Amit Dutta, Date - 07th OCT, 2025 */ +/* Let Us C, Chap - 5, Page - 84, Problem 5.3 */ + +#include &lt;stdio.h&gt; +int main() +{ + double num, result; + int power, i = 1; + printf(&quot;Enter the numbers in &#x27;num^power&#x27; format : &quot;); + // checking if the input is valid or not + if (scanf(&quot;%lf^%d&quot;, &amp;num, &amp;power) != 2) + { + printf(&quot;\nPlease enter numbers.&quot;); + return 1; + } + // result for the negetive input + if (power &lt; 0) + { + printf(&quot;\nPlease use a positive number as power.&quot;); + return 1; + } + // Hard codded result for input &#x27;0&#x27; (zero) + if (power == 0) + { + printf(&quot;\n%g to the power of %d is : 1&quot;, num, power); + return 0; + } + result = num; + while (i &lt;= power - 1) + { + result = result * num; + i++; + } + printf(&quot;\n%g to the power of %d is : %g&quot;, num, power, result); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem008-c', 'lucproblem008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem008-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a problem to print all the prime numbers from 1 to 300. */ +/* Author - Amit Dutta, Date - 24th OCT, 2025 */ +/* Let Us C, Chap - 6, Page - 101, Problem 6.1 */ + +// Method: Trial Division (Optimized to check up to sqrt(N)) + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;stdbool.h&gt; + +#define LIMIT 300 + +int main() +{ + printf(&quot;Prime numbers from 1 to 300 : 2&quot;); // as 2 is the only even prime number + for (int i = 3; i &lt;= LIMIT; i += 2) // skipping all other even number + { + int n = (int)sqrt(i); + bool prime = true; + + for (int j = 3; j &lt;= n; j += 2) + // an odd number is only devisable by another odd number. + // so, skipping even number. + { + if (i % j == 0) + { + prime = false; + break; + } + } + if (prime) + { + printf(&quot; %d&quot;, i); + } + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem009-c', 'lucproblem009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem009.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem009.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem009-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to add first seven terms of the following series using a +for loop. + 1 / 1! + 2 / 2! + 3 / 3! + ... +*/ +/* Author - Amit Dutta, Date - 24th OCT, 2025 */ +/* Let Us C, Chap - 6, Page - 102, Problem 6.2 */ + +#include &lt;stdio.h&gt; +#define N 7 // update N here + +int main() +{ + double sum = 0; int fact = 1; + for (int i = 1; i &lt;= N; i++) + { + fact *= i; + sum += (double)i / fact; + } + printf(&quot;Sum of the series : %g&quot;, sum); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem010-complex-c', 'lucproblem010-complex.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010-complex.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem010-complex.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010-complex.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem010-complex-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to generate all combinations (permutations) of 1, 2 and 3 + from 1-digit numbers up to 4-digit numbers using a main loop to control + the number of digits (1 to 3333). +*/ +/* Author - Amit Dutta, Date - 24th OCT, 2025 */ +/* Let Us C, Chap - 6, Page - 103, Problem 6.3 */ + +#include &lt;stdio.h&gt; + +// --- RECURSIVE FUNCTION TO ACHIEVE DYNAMIC NESTING --- +// current_digit: The digit being placed in the current position (1, 2, or 3) +// target_length: The total length of the number we are building (e.g., 3 for 3-digit numbers) +// current_number: The integer value built so far +// current_length: How many digits have been placed so far +void generate_combinations(int target_length, int current_number, int current_length) +{ + + // Base Case 1: The number is complete. Print it and return. + if (current_length == target_length) + { + printf(&quot; %d&quot;, current_number); + return; + } + + // Recursive Step: Try placing the next digit (1, 2, or 3) + // The for loop now iterates through the *possible values* for the next digit. + for (int next_digit = 1; next_digit &lt;= 3; next_digit++) + { + + // Build the new number: old_number * 10 + next_digit + int new_number = current_number * 10 + next_digit; + + // Recurse: Try to place the next digit + generate_combinations(target_length, new_number, current_length + 1); + } +} + +int main() +{ + printf(&quot;Combination of 1, 2 and 3 (1-digit up to 4-digits):\n&quot;); + + /* This outer loop achieves the structure you were going for: + iterating through the required number of digits (1, 2, 3, 4). + */ + for (int noOfDigits = 1; noOfDigits &lt;= 4; noOfDigits++) + { + printf(&quot;\n\n--- %d-DIGIT NUMBERS (%d total) ---\n&quot;, noOfDigits, (1 &lt;&lt; noOfDigits) * 3 / 4 * 4 / 3 * 3 * 3 / 9 * 3 + (noOfDigits == 1 ? 0 : 9) + (noOfDigits == 2 ? 0 : 9) + (noOfDigits == 3 ? 0 : 81) + (noOfDigits == 4 ? 0 : 0) + (noOfDigits == 1 ? 3 : 0) + (noOfDigits == 2 ? 9 : 0) + (noOfDigits == 3 ? 27 : 0) + (noOfDigits == 4 ? 81 : 0)); // Prints the count 3, 9, 27, or 81 + + // Start the recursive generation for the current length + generate_combinations(noOfDigits, 0, 0); + } + + printf(&quot;\n\nTotal permutations generated: 120\n&quot;); + + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem010-c', 'lucproblem010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem010.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem010-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to generate all combination of 1, 2 and 3 using for loop. */ +/* Author - Amit Dutta, Date - 24th OCT, 2025 */ +/* Let Us C, Chap - 6, Page - 103, Problem 6.3 */ + +#include &lt;stdio.h&gt; + +int main() +{ + printf(&quot;Combination of 1, 2 and 3 :&quot;); + + // for 1 digit numbers + for (int i = 1; i &lt;= 3; i++) + { + printf(&quot; %d&quot;, i); + } + + // for 2 digit numbers + for (int i = 1; i &lt;= 3; i++) + { + for (int j = 1; j &lt;= 3; j++) + { + printf(&quot; %d%d&quot;, i, j); + } + } + + // for 3 digit numbers + for (int i = 1; i &lt;= 3; i++) + { + for (int j = 1; j &lt;= 3; j++) + { + for (int k = 1; k &lt;= 3; k++) + { + printf(&quot; %d%d%d&quot;, i, j, k); + } + } + } + + // for 4 digit numbers + for (int i = 1; i &lt;= 3; i++) + { + for (int j = 1; j &lt;= 3; j++) + { + for (int k = 1; k &lt;= 3; k++) + { + for (int l = 1; l &lt;= 3; l++) + { + printf(&quot; %d%d%d%d&quot;, i, j, k, l); + } + } + } + } + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem011-c', 'lucproblem011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem011.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem011.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem011-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a menu driven program which has following options : + 1. Factorial of a number + 2. Prime or not + 3. Odd or even + 4. Exit +Once a menu item is selected the appropriate action should be taken +and once this action is finished, the menu should reappear. Unless +the user selects the &#x27;Exit&#x27; option the program should continue work. +*/ +/* Author - Amit Dutta, Date - 26th OCT, 2025 */ +/* Let Us C, Chap - 7, Page - 118, Problem 7.1 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;stdbool.h&gt; + +// Function to clear the input buffer after scanf to prevent issues in the next input. +void clearInputBuffer() +{ + int c; + while ((c = getchar()) != &#x27;\n&#x27; &amp;&amp; c != EOF) + ; +} + +// Calculates the factorial of the input number. +void factorial(int num) +{ + // Factorial is not defined for negative numbers. + if (num &lt; 0) + { + printf(&quot;\nFactorial is not defined for negative numbers.&quot;); + return; + } + // Checks for input over 20 to prevent long long integer overflow (20! is max safe). + if (num &gt; 20) + { + printf(&quot;\nFactorial of %d is too large to calculate (max safe integer factorial is 20!).&quot;, num); + return; + } + long long fact = 1; + // Calculate factorial iteratively. + for (int i = 1; i &lt;= num; i++) + { + fact *= i; + } + printf(&quot;\nFactorial of %d = %lld&quot;, num, fact); + return; +} + +// Checks if the input number is a prime number. +void prime(int num) +{ + // Handle special cases: 1 and 2. + if (num == 1) + { + printf(&quot;\nInput 1 is NOT a PRIME NUMBER.&quot;); + return; + } + else if (num == 2) + { + printf(&quot;\nInput 2 is a PRIME NUMBER. (Fact : 2 is only even prime number)&quot;); + return; + } + // Exclude all other even numbers. + if (num % 2 == 0) + { + printf(&quot;\nInput %d is NOT a PRIME NUMBER.&quot;, num); + return; + } + // Optimization: Only check divisors up to the square root of num. + int endCheckDigit = sqrt(num); + bool isPrime = true; + // Check only odd divisors (i += 2) starting from 3. + for (int i = 3; i &lt;= endCheckDigit; i += 2) + { + if (num % i == 0) + { + printf(&quot;\nInput %d is NOT a PRIME NUMBER.&quot;, num); + isPrime = false; + break; + } + } + if (isPrime) + { + printf(&quot;\nInput %d is a PRIME NUMBER.&quot;, num); + return; + } +} + +// Checks if the input number is odd or even. +void oddoreven(int num) +{ + // A number is even if it is perfectly divisible by 2. + if (num % 2 == 0) + { + printf(&quot;\nInput %d is a EVEN NUMBER.&quot;, num); + return; + } + else + { + printf(&quot;\nInput %d is a ODD NUMBER.&quot;, num); + return; + } +} + +// Main function: displays the menu and controls program flow. +int main() +{ + int choice, num; + // Infinite loop ensures the menu reappears after every operation until &#x27;Exit&#x27; is chosen. + while (1) + { + // Display menu options. + printf(&quot;\n\n===== MENU =====&quot; + &quot;\n1. Factorial of a number&quot; + &quot;\n2. Prime or not&quot; + &quot;\n3. Odd or Even&quot; + &quot;\n4. Exit&quot;); + printf(&quot;\nEnter your choice : &quot;); + + // Input validation for menu choice. + if (scanf(&quot;%d&quot;, &amp;choice) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + clearInputBuffer(); + continue; + } + clearInputBuffer(); + + // Handle menu selection using switch-case. + switch (choice) + { + case 1: + printf(&quot;\n=== FACTORIAL OF A NUMBER ===&quot;); + printf(&quot;\nEnter the number : &quot;); + // Input validation for the number to be factored. + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + clearInputBuffer(); + continue; + } + clearInputBuffer(); + factorial(num); + break; + case 2: + printf(&quot;\n=== PRIME OR NOT ===&quot;); + printf(&quot;\nEnter the number : &quot;); + // Input validation for the number to be checked. + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + clearInputBuffer(); + continue; + } + clearInputBuffer(); + // Require a non-negative, non-zero number for prime check. + if (num &lt; 0) + { + printf(&quot;\nPlease enter a postive number.&quot;); + continue; + } + else if (num == 0) + { + printf(&quot;\nPlease enter a non-zero number.&quot;); + continue; + } + prime(num); + break; + case 3: + printf(&quot;\n=== ODD OR EVEN ===&quot;); + printf(&quot;\nEnter the number : &quot;); + // Input validation for the number to be checked. + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + clearInputBuffer(); + continue; + } + clearInputBuffer(); + oddoreven(num); + break; + case 4: + // Exit the program cleanly. + printf(&quot;\nExiting the program.\n\nSAYONARA...\n\n&quot;); + exit(0); + default: + // Handle invalid menu choice input. + printf(&quot;\nPlease enter a valid choice.&quot;); + break; + } + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem012-c', 'lucproblem012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem012.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem012.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem012-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a Function power(a, b), to calculate the value of a raised to b */ +/* Author - Amit Dutta, Date - 17th November, 2025 */ +/* Let Us C, Chap - 8, Page - 141, Problem 8.2 */ + +#include &lt;stdio.h&gt; + +double power(double, int); + +double power(double a, int b) +{ + if (b == 0) + return 1; + double res = 1; + int i; + if (b &gt; 0) + for (i = 1; i &lt;= b; i++) + res *= a; + return res; +} + +int main() +{ + double a, result; + int b; + printf(&quot;Enter the value and the power (Format A^B) : &quot;); + scanf(&quot;%lf^%d&quot;, &amp;a, &amp;b); + result = power(a, b); + printf(&quot;Result of %g^%d = %g&quot;, a, b, result); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem013-c', 'lucproblem013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem013.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem013.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem013-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Define a function to convert any given year into its Roman equivalent. +Use these roman equivalent for decimal numbers : 1 - I, 5 - V, 10 - X, +50 - L, 100 - C, 500 - D, 1000 - M */ +/* Author - Amit Dutta, Date - 17th November, 2025 */ +/* Let Us C, Chap - 8, Page - 141, Problem 8.3 */ + +#include &lt;stdio.h&gt; + +void romanise(int); + +void romanise(int year) +{ + int values[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; + const char *romanChar[] = {&quot;M&quot;, &quot;CM&quot;, &quot;D&quot;, &quot;CD&quot;, &quot;C&quot;, &quot;XC&quot;, &quot;L&quot;, &quot;XL&quot;, &quot;X&quot;, &quot;IX&quot;, &quot;V&quot;, &quot;IV&quot;, &quot;I&quot;}; + // including the two-character subtractive pairs. + int i = 0; + + printf(&quot;Year %d = &quot;, year); + while (year &gt; 0) + { + if (year &gt;= values[i]) + { + printf(&quot;%s&quot;, romanChar[i]); + year -= values[i]; + } + else + i++; + } +} + +int main() +{ + int year; + printf(&quot;Enter the year : &quot;); + scanf(&quot;%d&quot;, &amp;year); + romanise(year); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem014-short-c', 'lucproblem014-short.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014-short.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem014-short.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014-short.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem014-short-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function that receives integers and returns the sum, average +and standard deviation of these numbers. Call this function from main() +and print the result in main() */ +/* Author - Amit Dutta, Date - 23th November, 2025 */ +/* Let Us C, Chap - 9, Page 159, Problem 9.1 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +void stats(double *, double *, double *); + +int main() +{ + double sum, average, standardDeviation; + stats(&amp;sum, &amp;average, &amp;standardDeviation); + + printf(&quot;\n--- Stats ---&quot; + &quot;\nSum: %g&quot; + &quot;\nAverage: %g&quot; + &quot;\nStandard Deviation: %g&quot;, + sum, average, standardDeviation); + return 0; +} + +void stats(double *sum, double *average, double *standardDeviation) +{ + int n; + printf(&quot;How many numbers you want to give input: &quot;); + scanf(&quot;%d&quot;, &amp;n); + + double inputNumber[n]; + int i; + + printf(&quot;\n--- Enter Numbers ---\n&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter number %d: &quot;, i + 1); + scanf(&quot;%lf&quot;, &amp;inputNumber[i]); + } + + double tempSum = 0; + for (i = 0; i &lt; n; i++) + tempSum += inputNumber[i]; + + double tempAverage = tempSum / n; + + double tempStandardDeviation = 0.0; + + if (n &gt; 1) + { + double tempSumation = 0; + for (i = 0; i &lt; n; i++) + tempSumation += pow((inputNumber[i] - tempAverage), 2.0); + + tempStandardDeviation = sqrt(tempSumation / (n - 1)); + } + + *sum = tempSum; + *average = tempAverage; + *standardDeviation = tempStandardDeviation; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem014-c', 'lucproblem014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem014.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem014-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function that receives integers and returns the sum, average +and standard deviation of these numbers. Call this function from main() +and print the result in main() */ +/* Author - Amit Dutta, Date - 23th November, 2025 */ +/* Let Us C, Chap - 9, Page 158, Problem 9.1 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +// Function prototype: Using pointers for &#x27;call by reference&#x27; to return 3 values. +void stats(double *, double *, double *); + +int main() +{ + double sum, average, standardDeviation; + // Passing addresses of variables to receive results from the function. + stats(&amp;sum, &amp;average, &amp;standardDeviation); + + printf(&quot;\n--- Stats ---&quot; + &quot;\nSum: %g&quot; + &quot;\nAverage: %g&quot; + &quot;\nStandard Deviation: %g&quot;, + sum, average, standardDeviation); + return 0; +} + +// Function to calculate statistics on user-provided numbers. +void stats(double *sum, double *average, double *standardDeviation) +{ + int n; + // Input Validation Loop for N + do + { + printf(&quot;How many numbers you want to give input: &quot;); + + if (scanf(&quot;%d&quot;, &amp;n) == 1) + { + break; + } + else + { + printf(&quot;\nPlease enter a valid number.\n&quot;); + // Clearing input buffer to handle invalid input + while (getchar() != &#x27;\n&#x27; &amp;&amp; !feof(stdin)) + ; + } + } while (1); + + // Variable-Length Array (VLA) to store the input numbers. + double inputNumber[n]; + int i = 0; + + printf(&quot;\n--- Enter Numbers ---\n&quot;); + + // Input Loop for numbers + while (i &lt; n) + { + printf(&quot;Enter number %d: &quot;, i + 1); + + if (scanf(&quot;%lf&quot;, &amp;inputNumber[i]) == 1) + { + // Clearing input buffer after successful read + while (getchar() != &#x27;\n&#x27;) + ; + i++; + } + else + { + printf(&quot;Invalid input. Only integers are allowed. Please try again.\n&quot;); + // Clearing input buffer to handle invalid input + while (getchar() != &#x27;\n&#x27; &amp;&amp; !feof(stdin)) + ; + } + } + + // 1. Sum Calculation + double tempSum = 0; + for (i = 0; i &lt; n; i++) + tempSum += inputNumber[i]; + + // 2. Average (Mean) calculation + double tempAverage = tempSum / n; + + // 3. Standard Deviation (Sample SD formula used) + double tempStandardDeviation = 0.0; + + // Preventing division by zero if n is 1. SD is 0 for a single number. + if (n &gt; 1) + { + double tempSumation = 0; + // calculating the sum of squared differences from the mean + for (i = 0; i &lt; n; i++) + tempSumation += pow((inputNumber[i] - tempAverage), 2.0); + + // Calculating sample standard deviation + tempStandardDeviation = sqrt(tempSumation / (n - 1)); + } + + // Assigning final values back to the variables in main(). + *sum = tempSum; + *average = tempAverage; + *standardDeviation = tempStandardDeviation; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem015-c', 'lucproblem015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem015.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem015.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem015-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program that defines a function that calculates power of one +number reaised to another and factorial value of a number in one cell. */ +/* Author - Amit Dutta, Date - 24th November, 2025 */ +/* Let Us C, Chap - 9, Page 159, Problem 9.2 */ + +#include &lt;stdio.h&gt; + +void bothPowerFactorial(double, int, int, double *, long long *); + +int main() +{ + double a, resultPower; + int b, factN; + long long resultFactorial; + printf(&quot;Enter a and b for calculating a raised to b: &quot;); + scanf(&quot;%lf %d&quot;, &amp;a, &amp;b); + printf(&quot;Enter number to calculate the factorial: &quot;); + scanf(&quot;%d&quot;, &amp;factN); + if (b &lt; 0 || factN &lt; 0) + { + printf(&quot;\nOnly non-negative integer is allowed as input of b and factorial.&quot;); + return 1; + } + bothPowerFactorial(a, b, factN, &amp;resultPower, &amp;resultFactorial); + printf(&quot;\n%g Raised to %d: %g&quot; + &quot;\nFactorial of %d: %lld&quot;, + a, b, resultPower, factN, resultFactorial); + return 0; +} + +void bothPowerFactorial(double a, int b, int n, double *resultPower, long long *resultFactorial) +{ + double tempResultPower = 1; + long long tempResultFactorial = 1; + int i; + + for (i = 1; i &lt;= b; i++) + tempResultPower *= a; + + for (i = 1; i &lt;= n; i++) + tempResultFactorial *= i; + + *resultPower = tempResultPower; + *resultFactorial = tempResultFactorial; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem016-c', 'lucproblem016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem016.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">lucproblem016.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-letusc-lucproblem016-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Figure 9.4 shows three memory locations and values stored in them. +Write a program to declare variables that implement the relationship +shown. How will you print the values and addresses shown in the figure? +On which machine the program should be executed to get such addresses? + +Figure 9.4: + value: 3.14, memory_address: 7fff9489c79c + value: 7fff9489c7a0, memory_address: 7fff4fd134b8 + value: 7fff9489c79c, memory_address: 7fff9489c7a0 +*/ +/* Author - Amit Dutta, Date - 24th November, 2025 */ +/* Let Us C, Chap - 9, Page 160, Problem 9.3 */ + +#include &lt;stdio.h&gt; + +int main() +{ + float a = 3.14; + float *c = &amp;a; + float **b = &amp;c; + + printf(&quot;Location 1 (Variable a):\n&quot;); + printf(&quot;Value: %g\n&quot;, a); + printf(&quot;Address: %p\n&quot;, (void *)&amp;a); + printf(&quot;------------------------------\n&quot;); + + printf(&quot;Location 3 (Variable c: float *):\n&quot;); + printf(&quot;Value (Address stored): %p\n&quot;, (void *)c); + printf(&quot;Address of c itself: %p\n&quot;, (void *)&amp;c); + printf(&quot;Value pointed to (*c): %g\n&quot;, *c); + printf(&quot;------------------------------\n&quot;); + + printf(&quot;Location 2 (Variable b: float **):\n&quot;); + printf(&quot;Value (Address stored): %p\n&quot;, (void *)b); + printf(&quot;Address of b itself: %p\n&quot;, (void *)&amp;b); + printf(&quot;Value pointed to (*b): %p\n&quot;, (void *)*b); + printf(&quot;Value pointed to (**b): %g\n&quot;, **b); + printf(&quot;------------------------------\n&quot;); + + return 0; +}</div> + </div> + + </div> + </div> + + <div class="folder-container mb-2"> + <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> + <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> + </svg> + <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <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" /> + </svg> + <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">tuition-c</span> + </div> + <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-001-c', 'APC-PRAC-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate area and perimeter of a rectangle +by accepting length and breadth as input. */ +// Author - Amit Dutta, Date - 18th SEP, 2025 + +#include&lt;stdio.h&gt; +int main() { + double length, breadth, area, perimeter; + printf(&quot;Enter the length and breadth of the Rectangle : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;length, &amp;breadth); + area = length * breadth; + perimeter = 2 * (length + breadth); + printf(&quot;\nArea of the Rectangle : %g&quot; + &quot;\nPerimeter of the Rectangle : %g&quot;, area, perimeter); + return 0; + +} + +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-002-c', 'APC-PRAC-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate area of a circle using math library +method. Take radius of the circle as input. */ +/* Author - Amit Dutta, Date - 18th SEP, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double r, area; + printf(&quot;Enter the radius of the circle : &quot;); + scanf(&quot;%lf&quot;, &amp;r); + area = M_PI * pow(r, 2); + printf(&quot;\nArea of the circle : %g&quot;, area); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-003-c', 'APC-PRAC-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to accept diagonal of a square and calculate area, parimeter */ +/* Author - Amit Dutta, Date - 18th SEP, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double dia, side, area, peri; + printf(&quot;Enter the diagonal of the square : &quot;); + scanf(&quot;%lf&quot;, &amp;dia); + side = dia / sqrt(2); + area = pow(side, 2); + peri = 4 * side; + printf(&quot;\nArea of the square : %g&quot; + &quot;\nPerimeter of the square : %g&quot;, + area, peri); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-004-c', 'APC-PRAC-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate and display radius of a circle by taking the area as input. */ +/* Author - Amit Dutta, Date - 18th SEP, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double r, area; + printf(&quot;Enter the area of the circle : &quot;); + scanf(&quot;%lf&quot;, &amp;area); + r = sqrt(area / M_PI); + printf(&quot;\nRadius of the circle : %g&quot;, r); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-005-c', 'APC-PRAC-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP a program that accept number of days +as input and represent it as years, months and days. */ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int days, months, years, temp; + printf(&quot;Enter the No. of days : &quot;); + scanf(&quot;%d&quot;, &amp;days); + temp = days; + years = days / 365; + days = days % 365; + months = days / 30; + days = days % 30; + printf(&quot;%d Days = %d Years, %d Months, %d Days&quot;, temp, years, months, days); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-006-c', 'APC-PRAC-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP that accept seconds as input and represent it an hours, minutes and seconds. */ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int sec, hours, minutes, temp; + printf(&quot;Enter the no of seconds : &quot;); + scanf(&quot;%d&quot;, &amp;sec); + temp = sec; + hours = sec / 3600; + sec = sec % 3600; + minutes = sec / 60; + sec = sec % 60; + printf(&quot;\n%d Seconds = %d Hours, %d Minutes, %d Seconds.&quot;, temp, hours, minutes, sec); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-007-c', 'APC-PRAC-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP that accept basic salary of an employee and display gross salary, +net salary generated by below formula. + DA = 25% of the basic salary. + HRA = 12.5% of the basic salary. + PF = 10% of the basic salary. + gross salary = basic salary + da + hra + net salary = gross salary - pf +*/ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + double bs, gs, ns, da, hra, pf; + printf(&quot;Enter the basic salary of the employee : &quot;); + scanf(&quot;%lf&quot;, &amp;bs); + da = bs * 0.25; + hra = bs * 0.125; + pf = bs * 0.10; + gs = bs + da + hra; + ns = gs - pf; + printf(&quot;\nGross Salary : %g&quot; + &quot;\nNet Salary : %g&quot;, + gs, ns); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-008-c', 'APC-PRAC-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-008-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to multiply and divide a number by 4 without +using multiplication and division operator. */ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int num, multi, div; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + multi = num &lt;&lt; 2; + div = num &gt;&gt; 2; + printf(&quot;Multiplication : %d&quot; + &quot;\nDivision : %d&quot;, + multi, div); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-009-c', 'APC-PRAC-009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-009.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-009.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-009-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to swap two integer variable without using Third variable. */ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int a = 4, b = 6; + printf(&quot;Before swap : A = %d and B = %d&quot;, a, b); + a = a ^ b; + b = a ^ b; + a = a ^ b; + printf(&quot;\nAfter swap : A = %d and B = %d&quot;, a, b); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-010-c', 'APC-PRAC-010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-010.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-010.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-010-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate and display the valve of the given expression : + (1/a^3) + (1/(b+2)^3) + (1/(c^4 + root(2))) + take a, b, c as input. +*/ +/* Author - Amit Dutta, Date - 19th SEP, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + double a, b, c, result; + printf(&quot;Enter the value for a, b and c : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;a, &amp;b, &amp;c); + result = (1 / pow(a, 3)) + (1 / pow((b + 2), 3)) + (1 / (pow(c, 4) + sqrt(2))); + printf(&quot;\nResult = %g&quot;, result); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-011-c', 'APC-PRAC-011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-011.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-011.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-011-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-012-c', 'APC-PRAC-012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-012.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-012.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-012-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-013-c', 'APC-PRAC-013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-013.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-013.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-013-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-014-c', 'APC-PRAC-014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-014.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-014.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-014-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-015-c', 'APC-PRAC-015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-015.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-015.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-015-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to display all numbers between lb (lower bound) and up (upper bound) +which ends with digit 7 or divisible by 7. */ +/* Author - Amit Dutta, Date - 06th November, 2025 */ +// File Name - amit0611202501.c (LAB), APC-PRAC-015.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 lb, ub, i; + printf(&quot;Enter the lb, ub : &quot;); + scanf(&quot;%d %d&quot;, &amp;lb, &amp;ub); + printf(&quot;\nEnds with 7 :&quot;); + for (i = lb; i &lt;= ub; i++) + { + if (i % 10 == 7) + { + printf(&quot; %d&quot;, i); + } + } + printf(&quot;\nDivisible by 7 :&quot;); + for (i = lb; i &lt;= ub; i++) + { + if (i % 7 == 0) + { + printf(&quot; %d&quot;, i); + } + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-016-c', 'APC-PRAC-016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-016.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-016.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-016-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check palindrome number. */ +/* Author - Amit Dutta, Date - 06th November, 2025 */ +// File Name - amit0611202502.c (LAB), APC-PRAC-016.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, rev = 0; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + temp = num; + while (temp &gt; 0) + { + rev = (rev * 10) + (temp % 10); + temp /= 10; + } + if (rev == num) + printf(&quot;\nInput %d is a palindrome number.&quot;, num); + else + printf(&quot;\nInput %d is not a palindrome number.&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-017-c', 'APC-PRAC-017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-017.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-017.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-017-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check perfect number. */ +/* Author - Amit Dutta, Date - 06th November, 2025 */ +// File Name - amit0611202503.c (LAB), APC-PRAC-017.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, i, divisibleSum = 0; + printf(&quot;Enter a number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + for (i = 1; i &lt;= num / 2; i++) + { + if (num % i == 0) + { + divisibleSum += i; + } + } + if (divisibleSum == num) + printf(&quot;\nInput %d ia a Perfect Number.&quot;, num); + else + printf(&quot;\nInput %d is NOT a Perfect Number.&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-018-c', 'APC-PRAC-018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-018.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-018.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-018-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check Automorphic Number. */ +/* Author - Amit Dutta, Date - 06th November, 2025 */ +// File Name - amit0611202504.c (LAB), APC-PRAC-018.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; + +int main() +{ + int num, square, count = 0, temp, modNum; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + square = (int)pow(num, 2); + temp = num; + while (temp &gt; 0) + { + temp /= 10; + count++; + } + modNum = (int)pow(10, count); + temp = square % modNum; + if (num == temp) + printf(&quot;\nInput %d is a Automorphic Number.&quot;, num); + else + printf(&quot;\nInput %d is a Automorphic Number.&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-019-c', 'APC-PRAC-019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-019.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-019.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-019-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-020-c', 'APC-PRAC-020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-020.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-020.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-020-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-021-c', 'APC-PRAC-021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-021.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-021.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-021-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-022-c', 'APC-PRAC-022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-022.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-022.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-022-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-023-c', 'APC-PRAC-023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-023.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-023.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-023-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* 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; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-024-c', 'APC-PRAC-024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-024.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-024.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-024-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 1 + 2 1 + 3 2 1 + 4 3 2 1 + 5 4 3 2 1 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202501.c (LAB), APC-PRAC-024.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = i; j &gt;= 1; j--) { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-025-c', 'APC-PRAC-025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-025.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-025.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-025-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 5 4 3 2 1 + 5 4 3 2 + 5 4 3 + 5 4 + 5 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202502.c (LAB), APC-PRAC-025.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = n; j &gt;= i; j--) { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-026-c', 'APC-PRAC-026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-026.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-026.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-026-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 5 + 5 4 + 5 4 3 + 5 4 3 2 + 5 4 3 2 1 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202503.c (LAB), APC-PRAC-026.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = n; i &gt;= 1; i--) { + for(j = n; j &gt;= i; j--) { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-027-c', 'APC-PRAC-027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-027.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-027.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-027-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 1 2 3 4 5 + 2 3 4 5 + 3 4 5 + 4 5 + 5 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202504.c (LAB), APC-PRAC-027.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = i; j &lt;= n; j++) { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-028-c', 'APC-PRAC-028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-028.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-028.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-028-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 1 + 2 3 + 4 5 6 + 7 8 9 10 + 11 12 13 14 15 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202505.c (LAB), APC-PRAC-028.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 n, i, j, temp = 1; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = 1; j &lt;= i; j++) { + printf(&quot;%d\t&quot;, temp); + temp++; + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-029-c', 'APC-PRAC-029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-029.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-029.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-029-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 1 + 1 0 + 1 0 1 + 1 0 1 0 + 1 0 1 0 1 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202506.c (LAB), APC-PRAC-029.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = 1; j &lt;= i; j++) { + if(j % 2 == 0) printf(&quot;0 &quot;); + else printf(&quot;1 &quot;); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-030-c', 'APC-PRAC-030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-030.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-030.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-030-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + # + @ @ + # # # + @ @ @ @ + # # # # # +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202507.c (LAB), APC-PRAC-030.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 n, i, j; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = 1; j &lt;= i; j++) { + if(i % 2 == 0) printf(&quot;@ &quot;); + else printf(&quot;# &quot;); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-031-c', 'APC-PRAC-031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-031.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-031.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-031-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + 1 2 3 4 5 + 6 7 8 9 + 10 11 12 + 13 14 + 15 +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202508.c (LAB), APC-PRAC-031.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 n, i, j, temp = 1; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = n; i &gt;= 1; i--) { + for(j = 1; j &lt;= i; j++) { + printf(&quot;%d\t&quot;, temp); + temp++; + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-032-c', 'APC-PRAC-032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-032.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-032.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-032-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Pattern: + A + B B + C C C + D D D D + E E E E E +*/ +/* Author = Amit Dutta, Date - 13th November, 2025 */ +// File Name - amit1311202509.c (LAB), APC-PRAC-032.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 n, i, j; char temp = &#x27;A&#x27;; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for(i = 1; i &lt;= n; i++) { + for(j = 1; j &lt;= i; j++) { + printf(&quot;%c\t&quot;, temp); + } + temp++; + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-033-c', 'APC-PRAC-033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-033.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-033.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-033-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Print the factorial of the digits off a number */ +/* Auhtor: Amit Dutta, Date: 20-11-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 factorial(int); + +int factorial(int n) +{ + int i, fact = 1; + for (i = 1; i &lt;= n; i++) + fact *= i; + return fact; +} + +int main() +{ + int n, temp; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (n &lt; 0) + { + printf(&quot;Only non-negetive number is allowed.&quot;); + return 1; + } + temp = n; + while (temp &gt; 0) + { + printf(&quot;\nFactorial of %d: %d&quot;, temp % 10, factorial(temp % 10)); + temp /= 10; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-034-c', 'APC-PRAC-034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-034.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-034.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-034-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Take a Range as input from user and print the prime number between it. */ +/* Auhtor: Amit Dutta, Date: 20-11-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; +#include &lt;math.h&gt; + +int isPrime(int); + +int isPrime(int n) +{ + if (n &lt;= 1) + return 0; + if (n == 2) + return 1; + if (n % 2 == 0) + return 0; + int temp = (int)sqrt(n), i; + for (i = 3; i &lt;= temp; i += 2) + if (n % i == 0) + return 0; + return 1; +} + +int main() +{ + int lb, ub, i; + printf(&quot;Enter the lower bound and the upper bound: &quot;); + scanf(&quot;%d %d&quot;, &amp;lb, &amp;ub); + printf(&quot;\nPrime numbers between %d and %d: &quot;, lb, ub); + for (i = lb; i &lt;= ub; i++) + if (isPrime(i)) + printf(&quot;%d &quot;, i); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-035-c', 'APC-PRAC-035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-035.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-035.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-035-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Print all the 3 and 4 digit palindrome number. */ +/* Auhtor: Amit Dutta, Date: 20-11-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 palindromeCheck(int); + +int palindromeCheck(int n) +{ + int temp = n, rev = 0; + while (temp &gt; 0) + { + rev = (rev * 10) + (temp % 10); + temp /= 10; + } + if (rev == n) + return 1; + else + return 0; +} + +int main() +{ + int i; + printf(&quot;Palindrome number of 3 and 4 digits: &quot;); + for (i = 100; i &lt;= 9999; i++) + if (palindromeCheck(i)) + printf(&quot;%d &quot;, i); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-036-c', 'APC-PRAC-036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-036.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-036.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-036-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Check krishnamurty number. */ +/* Auhtor: Amit Dutta, Date: 20-11-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 factorial(int); +int checkKrishnamurty(int); + +int factorial(int n) +{ + int i, fact = 1; + for (i = 1; i &lt;= n; i++) + fact *= i; + return fact; +} + +int checkKrishnamurty(int n) +{ + int temp1 = n, temp2 = 0; + while (temp1 &gt; 0) + { + temp2 += factorial(temp1 % 10); + temp1 /= 10; + } + if (temp2 == n) + return 1; + else + return 0; +} + +int main() +{ + int n; + printf(&quot;Enter the number: &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (checkKrishnamurty(n)) + printf(&quot;\nInput %d is a Krishnamurty number.&quot;, n); + else + printf(&quot;\ninput %d is not a Krishnamurty number.&quot;, n); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-037-c', 'APC-PRAC-037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-037.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-037.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-037-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Show all the armstrong number between a range. */ +/* Author: Amit Dutta, Date: 21-11-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; +#include &lt;math.h&gt; + +#define lowerBound 100 +#define upperBound 999 + +int isArmstrongNumber(int); + +int isArmstrongNumber(int n) +{ + int temp = n, sum = 0, count = 0; + while (temp &gt; 0) + { + count++; + temp /= 10; + } + temp = n; + while (temp &gt; 0) + { + sum += (int)pow(temp % 10, count); + temp /= 10; + } + return sum == n; +} + +int main() +{ + int n, i, count = 0; + printf(&quot;Armstrong number between %d and %d are: &quot;, lowerBound, upperBound); + for (i = lowerBound; i &lt;= upperBound; i++) + if (isArmstrongNumber(i)) + { + printf(&quot;%d &quot;, i); + count++; + } + printf(&quot;\n\nCount: %d\n&quot;, count); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-038-c', 'APC-PRAC-038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-038.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-038.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-038-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Print all combinations of two two-digit numbers such that the sum of digits of both numbers is equal. +Example: 23 and 41 → (2+3) = 5, (4+1) = 5. +*/ +/* Author: Amit Dutta, Date: 21-11-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() +{ + printf(&quot;Combinations of two two-digit numbers such that the sum of digits of both numbers is equal: &quot;); + int i, j, sum1, sum2, count = 0; + for (i = 10; i &lt;= 99; i++) + { + sum1 = (i % 10) + (i / 10); + for (j = i + 1; j &lt;= 99; j++) + { + sum2 = (j % 10) + (j / 10); + if (sum1 == sum2) + { + printf(&quot;(%d, %d) &quot;, i, j); + count++; + } + } + } + printf(&quot;\nCount: %d\n&quot;, count); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-039-c', 'APC-PRAC-039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-039.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-039.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-039-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Write a C program to print all unique combinations of three numbers (a, b, c) such that: +1 ≤ a, b, c ≤ 30 and a² + b² = c² (Pythagorean triplets) +*/ +/* Author: Amit Dutta, Date: 21-11-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() +{ + printf(&quot;a² + b² = c² : &quot;); + int i, j, k, sq1, sq2, count = 0; + for (i = 1; i &lt;= 30; i++) + { + sq1 = i * i; + for (j = i + 1; j &lt;= 30; j++) + { + sq2 = j * j; + for (k = j + 1; k &lt;= 30; k++) + { + if (sq1 + sq2 == k * k) + { + printf(&quot;(%d, %d, %d) &quot;, i, j, k); + count++; + } + } + } + } + printf(&quot;\n\nCount: %d\n&quot;, count); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-040-c', 'APC-PRAC-040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-040.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-040.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-040-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* +Write a C program to count how many numbers between 100 and 999 have all distinct digits (e.g., 123, 709, 981). +*/ +/* Author: Amit Dutta, Date: 21-11-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() +{ + int i, count = 0, n1, n2, n3; + printf(&quot;Distinct numbers between 100 and 999: &quot;); + for (i = 100; i &lt;= 999; i++) + { + n1 = i / 100; + n2 = (i % 100) / 10; + n3 = i % 10; + if (n1 != n2 &amp;&amp; n2 != n3 &amp;&amp; n1 != n3) + { + printf(&quot;%d &quot;, i); + count++; + } + } + printf(&quot;\nCount: %d\n&quot;, count); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-041-c', 'APC-PRAC-041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-041.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-041.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-041-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* +Write a C program to find and print all twin prime pairs between 1 and n using nested loops. +(Twin primes are prime numbers having a difference of 2, like 11 and 13) +*/ +/* Author: Amit Dutta, Date: 21-11-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; +#include &lt;math.h&gt; + +int isPrime(int n) +{ + if (n &lt; 2) + return 0; + if (n == 2) + return 1; + if (n % 2 == 0) + return 0; + int i, temp = (int)sqrt(n); + for (i = 3; i &lt;= temp; i += 2) + if (n % i == 0) + return 0; + return 1; +} + +int main() +{ + int n, i, count = 0; + printf(&quot;enter the n: &quot;); + scanf(&quot;%d&quot;, &amp;n); + printf(&quot;\nAll the twin numbers: &quot;); + for (i = 1; i &lt;= n - 2; i++) + { + if (isPrime(i)) + { + if (isPrime(i + 2)) + { + printf(&quot;(%d, %d) &quot;, i, i + 2); + count++; + } + } + } + printf(&quot;\nCount; %d&quot;, count); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-PRAC-042-c', 'APC-PRAC-042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-042.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-PRAC-042.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-PRAC-042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-PRAC-042-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a function to check whether a given string is a palindrome. Use this function to +determine whether an entered string is Palindrome. */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +int isPalindrome(char[]); + +int main() +{ + char input[100]; + int len; + + printf(&quot;Enter the string (Max: 100 Character): &quot;); + fgets(input, sizeof(input), stdin); + len = strlen(input); + + if (len &gt; 0 &amp;&amp; input[len - 1] == &#x27;\n&#x27;) + { + input[len - 1] = &#x27;\0&#x27;; + } + + if (isPalindrome(input)) + { + printf(&quot;\nInput string \&quot;%s\&quot; is Palindrome.&quot;, input); + } + else + { + printf(&quot;\nInput string \&quot;%s\&quot; is not Palindrome&quot;, input); + } + + return 0; +} + +int isPalindrome(char str[]) +{ + char *start = str; + char *end; + int len = strlen(str); + + if (len == 0) + { + return 1; + } + + end = str + (len - 1); + + while (start &lt; end) + { + if (*start != *end) + { + return 0; + } + start++; + end--; + } + + return 1; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-001-c', 'APC-S-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +#include&lt;stdio.h&gt; +int main() { + int a = 9, b = 4, c; + c = a + b; + printf(&quot;A + B = %d\n&quot;, c); + c = a / b; + printf(&quot;A / B = %d\n&quot;, c); + c = a % b; + printf(&quot;A %% B = %d\n&quot;, c); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-002-c', 'APC-S-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +#include&lt;stdio.h&gt; +int main() { + int a = 5, b = 5, c = 10; + printf(&quot;a = b = %d\n&quot;, a == b); + printf(&quot;a &gt; b = %d\n&quot;, a &gt; b); + printf(&quot;a &lt; b = %d\n&quot;, a &lt; b); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-003-c', 'APC-S-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +#include &lt;stdio.h&gt; +int main() { + int a = 5, b = 5, c = 10, result; + + result = (a == b) &amp;&amp; (c &gt; b); + printf(&quot;Result is %d\n&quot;, result); + + result = (a == b) &amp;&amp; (c &lt; b); + printf(&quot;Result is %d\n&quot;, result); + + result = (a != b) || (c &lt; b); + printf(&quot;Result is %d\n&quot;, result); + + result = (a != b) || (c &lt; b); + printf(&quot;Result is %d\n&quot;, result); + + result = !(a != b); + printf(&quot;Result is %d\n&quot;, result); + + result = !(a == b); + printf(&quot;Result is %d\n&quot;, result); + + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-004-c', 'APC-S-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Program to print first 10 natural numbers using while loop. */ +/* Author - Amit Dutta, Date - 29th October, 2025 */ + +/* + * Compiler Note: This source code is specifically designed for compilation + * and execution within the ** Turbo C ** environment. + * + * Testing Disclaimer: Due to a lack of access to the required Turbo C + * compiler software, this code has not been formally compiled or tested. + */ + +#include &lt;stdio.h&gt; +#include &lt;conio.h&gt; + +void main() +{ + clrscr(); + int x; + x = 1; + while (x &lt;= 10) + { + printf(&quot;%d &quot;, x); + x++; + } + getch(); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-005-c', 'APC-S-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write to reverse a number. */ +/* Author - Amit Dutta, Date - 29th October, 2025 */ + +/* + * Compiler Note: This source code is specifically designed for compilation + * and execution within the ** Turbo C ** environment. + * + * Testing Disclaimer: Due to a lack of access to the required Turbo C + * compiler software, this code has not been formally compiled or tested. + */ + +#include &lt;stdio.h&gt; +#include &lt;conio.h&gt; + +void main() +{ + clrscr(); + int n, reverse = 0, rem; + printf(&quot;Enter the numner : &quot;); + scanf(&quot;%d&quot;, &amp;n); + while (n != 0) + { + rem = n % 10; + reverse = reverse * 10 + rem; + n /= 10; + } + printf(&quot;Reversed Number : %d&quot;, reverse); + getch(); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-006-c', 'APC-S-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print first 10 multiple of 5 */ +/* Author - Amit Dutta, Date - 29th October, 2025 */ + +/* + * Compiler Note: This source code is specifically designed for compilation + * and execution within the ** Turbo C ** environment. + * + * Testing Disclaimer: Due to a lack of access to the required Turbo C + * compiler software, this code has not been formally compiled or tested. + */ + +#include &lt;stdio.h&gt; +#include &lt;conio.h&gt; + +void main() +{ + clrscr(); + int a = 5, i = 1, res; + while (i &lt;= 10) + { + res = a * i; + printf(&quot;%d * %d = %d\n&quot;, a, i, res); + i++; + } + getch(); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-007-c', 'APC-S-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program the sum of first 10 natural numbers. */ +/* Author - Amit Dutta, Date - 29th October, 2025 */ + +/* + * Compiler Note: This source code is specifically designed for compilation + * and execution within the ** Turbo C ** environment. + * + * Testing Disclaimer: Due to a lack of access to the required Turbo C + * compiler software, this code has not been formally compiled or tested. + */ + +#include &lt;stdio.h&gt; +#include &lt;conio.h&gt; + +void main() +{ + clrscr(); + int i, sum = 0; + for (i = 1; i &lt;= 10; i++) + { + sum += i; + } + printf(&quot;\nSum of the first natural number : %d&quot;, sum); + getch(); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-008-c', 'APC-S-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-008-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print the sum of two matrix as input given by the user. */ +/* Author: Amit Dutta, Date: 18-11-2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int rows, cols, i, j; + printf(&quot;Enter the number of rows and columns: &quot;); + scanf(&quot;%d %d&quot;, &amp;rows, &amp;cols); + + int a[rows][cols], b[rows][cols], c[rows][cols]; + + printf(&quot;Enter the elements of matrix A (%d x %d): \n&quot;, rows, cols); + for (i = 0; i &lt; rows; i++) + for (j = 0; j &lt; cols; j++) + { + printf(&quot;Position %d%d: &quot;, i, j); + scanf(&quot;%d&quot;, &amp;a[i][j]); + } + printf(&quot;\nMatrix A: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + printf(&quot;%d &quot;, a[i][j]); + printf(&quot;\n&quot;); + } + + printf(&quot;\nEnter the elements of matrix B(%d x %d): \n&quot;, rows, cols); + for (i = 0; i &lt; rows; i++) + for (j = 0; j &lt; cols; j++) + { + printf(&quot;Position %d%d: &quot;, i, j); + scanf(&quot;%d&quot;, &amp;b[i][j]); + } + printf(&quot;\nMatrix B: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + printf(&quot;%d &quot;, b[i][j]); + printf(&quot;\n&quot;); + } + + for (i = 0; i &lt; rows; i++) + for (j = 0; j &lt; cols; j++) + c[i][j] = a[i][j] + b[i][j]; + + printf(&quot;\nResult Matrix: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + printf(&quot;%d &quot;, c[i][j]); + printf(&quot;\n&quot;); + } + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-009-c', 'APC-S-009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-009.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-009.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-009-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the upper and lower triangular matrix. */ +/* Author: Amit Dutta, Date: 18-11-2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, rows, cols; + printf(&quot;\nEnter the number of rows and columns : &quot;); + scanf(&quot;%d %d&quot;, &amp;rows, &amp;cols); + + if (rows != cols) + { + printf(&quot;Triangular matrix definitions only apply to square matrices (rows == columns).\n&quot;); + return 1; + } + + int matrix[rows][cols]; + + printf(&quot;Enter the elements of matrix (%d x %d): \n&quot;, rows, cols); + for (i = 0; i &lt; rows; i++) + for (j = 0; j &lt; cols; j++) + { + printf(&quot;Position %d%d: &quot;, i, j); + scanf(&quot;%d&quot;, &amp;matrix[i][j]); + } + printf(&quot;\nMatrix: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + printf(&quot;%d &quot;, matrix[i][j]); + printf(&quot;\n&quot;); + } + + printf(&quot;\nUpper triangular of the Matrix: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + { + if (j &gt;= i) + printf(&quot;%d &quot;, matrix[i][j]); + else + printf(&quot;~ &quot;); + } + printf(&quot;\n&quot;); + } + + printf(&quot;\nLower triangular of the Matrix: \n&quot;); + for (i = 0; i &lt; rows; i++) + { + for (j = 0; j &lt; cols; j++) + { + if (j &lt;= i) + printf(&quot;%d &quot;, matrix[i][j]); + else + printf(&quot;~ &quot;); + } + printf(&quot;\n&quot;); + } + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-010-c', 'APC-S-010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-010.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-010.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-010-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to input a new element at a specific position of an array. + a[] = {4, 5, 2, 10, 6, 9, 8}, newItem = 7, position = 3 +*/ +/* Author: Amit Dutta, Date: 18-11-2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int a[8] = {4, 5, 2, 10, 6, 9, 8}; + int i; + + printf(&quot;Elemnts of the array: &quot;); + for (i = 0; i &lt;= 6; i++) + printf(&quot;%d &quot;, a[i]); + + printf(&quot;\nMethod 1: &quot;); + for (i = 7; i &gt;= 4; i--) + a[i] = a[i - 1]; + a[3] = 7; + for (i = 0; i &lt;= 7; i++) + printf(&quot;%d &quot;, a[i]); + + // another method + printf(&quot;\nMethod 2: &quot;); + int b[8] = {4, 5, 2, 10, 6, 9, 8}; + int temp1 = 7; + for (i = 3; i &lt;= 7; i++) + { + int temp2 = b[i]; + b[i] = temp1; + temp1 = temp2; + } + for (i = 0; i &lt;= 7; i++) + printf(&quot;%d &quot;, b[i]); + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-011-c', 'APC-S-011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-011.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-011.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-011-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Linear search */ +/* Author: Amit Dutta, Date: 19-11-2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int elementCount, i, keyElement; + + printf(&quot;Enter the number of element you want to add: &quot;); + scanf(&quot;%d&quot;, &amp;elementCount); + + int elements[elementCount]; + + for (i = 0; i &lt; elementCount; i++) + { + printf(&quot;Enter Element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;elements[i]); + } + + printf(&quot;\nEnter the Key Element you want to search: &quot;); + scanf(&quot;%d&quot;, &amp;keyElement); + for (i = 0; i &lt; elementCount; i++) + if (elements[i] == keyElement) + { + printf(&quot;\nKey Element %d is found in %d position.&quot;, keyElement, i); + return 0; + } + printf(&quot;\nKey Element %d is not found.&quot;, keyElement); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-012-c', 'APC-S-012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-012.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-012.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-012-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check if a matrix is a sparx matrix. */ +/* Author: Amit Dutta, Date: 19-11-2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, row, col, count = 0; + + printf(&quot;Enter the number of rows and columns in the matrix: &quot;); + scanf(&quot;%d %d&quot;, &amp;row, &amp;col); + + int matrix[row][col]; + + for (i = 0; i &lt; row; i++) + for (j = 0; j &lt; col; j++) + { + printf(&quot;Postion %d%d: &quot;, i, j); + scanf(&quot;%d&quot;, &amp;matrix[i][j]); + if (matrix[i][j] == 0) + count++; + } + + printf(&quot;\nEntered Matrix: \n&quot;); + for (i = 0; i &lt; row; i++) + { + for (j = 0; j &lt; col; j++) + printf(&quot;%d &quot;, matrix[i][j]); + printf(&quot;\n&quot;); + } + + if (count &gt; (row * col) / 2) + printf(&quot;\nEntered matrix is a Sparx Matrix.&quot;); + else + printf(&quot;\nEntered matrix is not a Sparx Matrix&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-013-c', 'APC-S-013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-013.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-013.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-013-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a fuction to calculate the average of an array */ +/* Author: Amit Dutta, Date: 26-11-2025 */ + +#include &lt;stdio.h&gt; + +double average(int []); + +int main() +{ + int marks[10], i; + printf(&quot;\nEnter 10 numbers: \n&quot;); + for (i = 0; i &lt;= 9; i++) + { + printf(&quot;Enter number %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;marks[i]); + } + printf(&quot;\nAverage = %g&quot;, average(marks)); + return 0; +} + +double average(int marks[10]) +{ + int sum = 0; + for (int i = 0; i &lt;= 9; i++) + sum += marks[i]; + return sum / 10.0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-S-014-c', 'APC-S-014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-014.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-S-014.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-S-014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-S-014-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to store roll no, name and marks of 5 students then print it. use structure */ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +struct student +{ + int roll_no; + char name[30]; + float marks; +}; + +int main() +{ + int i, stu_count = 3; + struct student s[stu_count]; + for (i = 0; i &lt; stu_count; i++) + { + printf(&quot;\nEnter the Roll Number: &quot;); + scanf(&quot;%d&quot;, &amp;s[i].roll_no); + getchar(); + printf(&quot;Enter the name: &quot;); + gets(s[i].name); + printf(&quot;Enter the Marks: &quot;); + scanf(&quot;%f&quot;, &amp;s[i].marks); + } + printf(&quot;\n%-10s %-20s %-10s\n&quot;, &quot;ROLL&quot;, &quot;NAME&quot;, &quot;MARKS&quot;); + printf(&quot;%-10s %-20s %-10s\n&quot;, &quot;====&quot;, &quot;====&quot;, &quot;=====&quot;); + for (i = 0; i &lt; stu_count; i++) + { + printf(&quot;%-10d %-20s %-10.2f\n&quot;, s[i].roll_no, s[i].name, s[i].marks); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-001-c', 'APC-SPS-001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +// WAP to perform arithmatic operation on integer data + +#include&lt;stdio.h&gt; +int main() { + int a, b, sum, sub, multi, div, mod; + printf(&quot;Enter 1st number : &quot;); + scanf(&quot;%d&quot;, &amp;a); + printf(&quot;Enter 2nd number : &quot;); + scanf(&quot;%d&quot;, &amp;b); + sum = a + b; + sub = a - b; + multi = a * b; + div = a / b; + mod = a % b; + printf(&quot;\nSum = %d&quot;, sum); + printf(&quot;\nSubtraction = %d&quot;, sub); + printf(&quot;\nMultiplication = %d&quot;, multi); + printf(&quot;\nDivision = %d&quot;, div); + printf(&quot;\nModulas = %d&quot;, div); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-002-c', 'APC-SPS-002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to swap two integers. Display both numbers +before and after swap */ + +#include&lt;stdio.h&gt; +int main() { + int a = 10, b = 20, temp; + printf(&quot;Before swap A : %d, B : %d&quot;, a, b); + temp = a; + a = b; + b = temp; + printf(&quot;\nAfter swap A : %d, B : %d&quot;, a, b); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-003-c', 'APC-SPS-003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Bitwise AND &#x27;&amp;&#x27; */ + +#include&lt;stdio.h&gt; +int main() { + unsigned int a = 4, b = 5, c = 6; + unsigned int x, y; + x = a &amp; b; + y = b &amp; c; + printf(&quot;x = %u y = %u&quot;, x, y); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-004-c', 'APC-SPS-004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +#include&lt;stdio.h&gt; +int main() { + int x = 25, y = 19, z; + z = x - y; + z = z &amp; x ; + printf(&quot;Z = %d&quot;, z); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-005-c', 'APC-SPS-005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Bitwise OR &#x27;|&#x27; */ + +#include&lt;stdio.h&gt; +int main() { + int x = 12, y = 14, z = 10, res; + x++; + z++; + x = x + y + z; + res = x | y; + z = res | z; + printf(&quot;x = %d y = %d z = %d res = %d&quot;, x, y, z, res); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-006-c', 'APC-SPS-006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Bitwise NOT &#x27;~&#x27; */ + +#include&lt;stdio.h&gt; +int main() { + int x = 12, y = 15, z = 21; + int res, res1, res2; + res = x &gt; 10; + res1 = ~res; + res2 = ~x; + printf(&quot;REs = %d, Res1 = %d, Res2 = %d&quot;, res, res1, res2); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-007-c', 'APC-SPS-007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to check a number is even or odd using bitwise operator */ + +#include&lt;stdio.h&gt; +int main() { + int x, res = 1; + printf(&quot;Enter a number : &quot;); + scanf(&quot;%d&quot;, &amp;x); + res = res &amp; x; + if (res == 0) { + printf(&quot;\nInput %d is a even number.&quot;, x); + } + else { + printf(&quot;\nInput %d is a odd number.&quot;, x); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-APC-SPS-008-c', 'APC-SPS-008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">APC-SPS-008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/APC-SPS-008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-APC-SPS-008-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate area of circle by accepting radius as input */ +/* Author : Amit Dutta, Date : 15th September, 2025 */ + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double r, area; + printf(&quot;Enter the radius of circle : &quot;); + scanf(&quot;%lf&quot;, &amp;r); + area = M_PI * r * r; + printf(&quot;\nArea : %lf&quot;, area); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P001-c', 'P001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P001.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P001.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P001-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +//sample code +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + printf(&quot;Hello world&quot;); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P002-c', 'P002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P002.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P002.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P002-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +//sample code with a new line charecter +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + printf(&quot;Hello\nworld&quot;); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P003-c', 'P003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P003.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P003.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P003-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +//WAP to perform addtion and multiplication of two integer numbers +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + int a, b, sum, multi; + printf(&quot;Enter the 1st number : &quot;); + scanf(&quot;%d&quot;,&amp;a); + printf(&quot;Enter the 2nd number : &quot;); + scanf(&quot;%d&quot;,&amp;b); + sum = a + b; + multi = a * b; + printf(&quot;\nSum = %d&quot; + &quot;\nMultiplication = %d&quot;,sum,multi); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P004-c', 'P004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P004.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P004.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P004-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to find and display the value of given expression : +((x+3)/4) - ((2x+4)/3) taking the value of x = 5 */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + double x =5, result; + result = ((x + 3) / 4) - ((2 * x + 4) / 3); + printf(&quot;Result = %lf&quot;,result); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P005-c', 'P005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P005.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P005.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P005-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* A person is paid Rs. 455 for each day he works and fined +Rs. 150 for each day he remains absent. WAP to calculate his +monthly income taking the number of days present as input. */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + int daily_wage = 455, fine = 150, present, absent, income; + printf(&quot;No of days present : &quot;); + scanf(&quot;%d&quot;, &amp;present); + absent = 30 - present; + income = (present * 455) - (absent * 150); + printf(&quot;\nIncome : %d&quot;,income); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P006-c', 'P006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P006.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P006.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P006-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* The normal temperature of human body +is 98.6 Degree Fahrenheit. WAP to convert the temperature +to Degree Celcius and display the output. */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + double f = 98.6, c; + c = ((f - 32) * 5) / 9; + printf(&quot;Temperature in Celcius is : %lf&quot;,c); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P007-c', 'P007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P007.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P007.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P007-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* A shopkeeper offers 10% discount on printed +price of a digital camera. However a customer has +to pay 6% GST on the remaining amount. WAP to +calculate and display the amount to paid by the +customer, taking the printed price as input. */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + double mrp, final_price, temp; + printf(&quot;Enter the printed price : &quot;); + scanf(&quot;%lf&quot;, &amp;mrp); + temp = mrp * 0.90; + final_price = temp * 1.06; + printf(&quot;\nCustomer have to pay : %lf&quot;, final_price); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P008-c', 'P008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P008.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P008.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P008-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* A shopkeeper offers 30% discount on purchasing an +item whereas the other shopkeeper offers 2 successive +discount of 20% and 10% for purchasing the same item. +WAP to caompute and display the discounted price of the +item by taking the price as input. */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + double mrp, shop1, shop2, temp; + printf(&quot;Enter the price : &quot;); + scanf(&quot;%lf&quot;, &amp;mrp); + shop1 = mrp * 0.70; + temp = mrp * 0.80; + shop2 = temp * 0.90; + printf(&quot;\nShopkeeper 1 price : %lf&quot; + &quot;\nShopkeeper 2 price : %lf&quot;,shop1,shop2); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P009-c', 'P009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P009.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P009.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P009-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate gross and net salary +by accepting basic salary as input. +IMP : DA = 30% of Basic Pay + HRA = 20% of Basic Pay + PF = 12.5% of Basic Pay + Gross Salary = Basic Pay + DA + HRA + Net Salary = Gross Salary - PF +*/ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + double bs, da, hra, pf, gs, ns; + printf(&quot;Enter the Basic Salary : &quot;); + scanf(&quot;%lf&quot;, &amp;bs); + da = bs * 0.3; + hra = bs * 0.2; + pf = bs * 0.125; + gs = bs + da + hra; + ns = gs - pf; + printf(&quot;\nGross Salary : %lf&quot; + &quot;\nNet Salary : %lf&quot;, gs, ns); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P010-c', 'P010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P010.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P010.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P010-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to find and display the difference +between compound Interest and Simple Interest. +Take principle amount as input. +Hint : si = (p * r * t) / 100 + a = p * ((1 + (r / 100)) ^ t) + ci = a - p +*/ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double p, r, t, si, a, ci, dif; + printf(&quot;Enter the principle amount, rate of interest, time in year : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;p, &amp;r, &amp;t); + si = (p * r * t) / 100; + a = p * pow((1 + (r / 100)), t); + ci = a - p; + dif = ci - si; + printf(&quot;\nSimple Interest : %lf&quot; + &quot;\nCompound Interest : %lf&quot; + &quot;\nInterest Difference : %lf&quot;, si, ci, dif); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P011-c', 'P011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P011.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P011.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P011-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* The time period of a simple pendulam is +given by the formula : + t = 2 * pi * square_root(l / g) +WAP to calculate T take length(L) and gravity +as input +*/ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double l, g, t; + printf(&quot;Enter the Length and Gravity measures : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;l, &amp;g); + t = 2 * M_PI * sqrt(l / g); + // using M_PI variable for PI value from math.h header file + printf(&quot;\nTime Period : %lf&quot;, t); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P012-c', 'P012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P012.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P012.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P012-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to swap two integer variable without +using third variable */ +// using Approch Mode : simple, slow, time consuming +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + int a = 4, b = 6; + printf(&quot;Before Swap : A = %d, B = %d&quot;, a, b); + a = a + b; + b = a - b; + a = a - b; + printf(&quot;\nAfter Swap : A = %d, B = %d&quot;, a, b); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P013-c', 'P013.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P013.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P013.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P013.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P013-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to swap two integer variable without +using third variable */ +// using Approch Mode : complex, fast, less time consumimg +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + int a = 4, b = 6; + printf(&quot;Before Swap : A = %d, B = %d&quot;, a, b); + a = a ^ b; + b = a ^ b; + a = a ^ b; + printf(&quot;\nAfter Swap : A = %d, B = %d&quot;, a, b); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P014-c', 'P014.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P014.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P014.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P014.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P014-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to accept the diagonal of +square. Find and display the area and +perimeter of the square. */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double d, side, area, per; + printf(&quot;Enter the diagonal : &quot;); + scanf(&quot;%lf&quot;, &amp;d); + side = d / sqrt (2); + area = side * side; + per = 4 * side; + printf(&quot;\nArea of the Square : %lf&quot; + &quot;\nPerimeter of the Square : %lf&quot;, area, per); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P015-c', 'P015.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P015.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P015.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P015.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P015-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/*WAP to accept number of days and +display it after converting into +number of years, months and days */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +int main() { + int day, month, year, temp; + printf(&quot;Enter the number of days : &quot;); + scanf(&quot;%d&quot;, &amp;day); + temp = day; + year = day / 365; + day = day % 365; + month = day / 30; + day = day % 30; + printf(&quot;\n%d Days = %d Years %d Months %d Days&quot;, temp, year, month, day); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P016-c', 'P016.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P016.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P016.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P016.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P016-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate and display radius of a +circle by taking the area as input */ +// Author - Amit Dutta, Date - Unknown + +#include&lt;stdio.h&gt; +#include&lt;math.h&gt; +int main() { + double area, r; + printf(&quot;Enter the area of a circle : &quot;); + scanf(&quot;%lf&quot;, &amp;area); + r = sqrt((7 * area) / 22); + printf(&quot;\nRadius : %lf&quot;, r); + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P017-c', 'P017.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P017.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P017.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P017.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P017-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Find maximum between three number. */ +// Author - Amit Dutta, Date - Unknown + +#include &lt;stdio.h&gt; +int main() +{ + int a, b, c, max; + printf(&quot;Enter the value for a, b, c : &quot;); + scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); + max = a; + if (max &lt; b) + max = b; + if (max &lt; c) + max = c; + printf(&quot;Maximum : %d&quot;, max); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P018-c', 'P018.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P018.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P018.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P018.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P018-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input the cost price and selling price and +calculate profit, profit percentage, loss percentage or +display the manage nither profit nor loss. */ +// Author - Amit Dutta, Date - Unknown + +#include &lt;stdio.h&gt; +int main() +{ + double cost, sell, pro, prop, loss, lossp; + printf(&quot;Enter the cost and selling price : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;cost, &amp;sell); + if (sell &gt; cost) + { + pro = sell - cost; + prop = (pro / cost) * 100; + printf(&quot;Profit : RS %g, Profit Percentage : %g&quot;, pro, prop); + } + else if (sell &lt; cost) + { + loss = cost - sell; + lossp = (loss / cost) * 100; + printf(&quot;Loss : RS %g, Loss Percentage : %g&quot;, loss, lossp); + } + else + printf(&quot;Neither loss nor Profit.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P019-c', 'P019.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P019.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P019.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P019.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P019-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input the distance covered and calculate +the amount to be paid by the passanger. + Distance Rate + =&lt;5KM RS 90 + next 10KM RS 20/KM + next 10KM RS 10/KM + more than 25KM RS 9/KM +*/ +// Author - Amit Dutta, Date - Unknown + +#include &lt;stdio.h&gt; +int main() +{ + double dis, amt; + printf(&quot;Enter the distance : &quot;); + scanf(&quot;%lf&quot;, &amp;dis); + if (dis &lt;= 5.0) + amt = 90.0; + else if (dis &gt; 5.0 &amp;&amp; dis &lt;= 15.0) + amt = 90.0 + (dis - 5.0) * 20; + else if (dis &gt; 15.0 &amp;&amp; dis &lt;= 25.0) + amt = 90.0 + 200.0 + (dis - 15.0) * 10; + else if (dis &gt; 25.0) + amt = 90.0 + 200.0 + 100.0 + (dis - 25.0) * 9; + printf(&quot;\nAmount to be paid : %g&quot;, amt); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P020-c', 'P020.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P020.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P020.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P020.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P020-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate and display the maturity amount +taking the sum and number of days as input. + No. of Days Rate of Interest + Upto 180 days 5.5 % + 181 to 364 days 7.5 % + exact 365 days 9.0 % + more than 365 days 8.5 % +*/ +// Author - Amit Dutta, Date - Unknown + +#include &lt;stdio.h&gt; +int main() +{ + double nod, amt, s, i; + printf(&quot;Enter the amount and the time in days : &quot;); + scanf(&quot;%lf %lf&quot;, &amp;s, &amp;nod); + if (nod &lt;= 180) + i = (s * 5.5 * (nod / 365)) / 100; + else if (nod &gt; 180.0 &amp;&amp; nod &lt;= 364.0) + i = (s * 7.5 * (nod / 365)) / 100; + else if (nod == 365.0) + i = (s * 9.0 * 1) / 100; + else if (nod &gt; 365.0) + i = (s * 8.5 * (nod / 365)) / 100; + amt = s + i; + printf(&quot;Amount to be paid : %g&quot;, amt); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P021-c', 'P021.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P021.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P021.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P021.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P021-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input a positive number and check if it is a perfect +square number or not. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +int main() +{ + int n, temp; + double sr; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + sr = sqrt(n); + temp = (int)sr; + if (temp * temp == n) + printf(&quot;\nThis is a perfect square.&quot;); + else + printf(&quot;\nThis is not a perfect square.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P022-c', 'P022.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P022.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P022.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P022.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P022-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to find out smallest of three numbers without using if_else block. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +int main() +{ + int a, b, c, min; + printf(&quot;Enter three number : &quot;); + scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); + min = (a &lt; b &amp;&amp; a &lt; c) ? a : (b &lt; a &amp;&amp; b &lt; c) ? b + : c; + printf(&quot;Minimum = %d&quot;, min); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P023-c', 'P023.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P023.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P023.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P023.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P023-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input the total cost and compute the amount to be paid +by the customer. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +int main() +{ + double cost, amt; + printf(&quot;Enter the total cost : &quot;); + scanf(&quot;%lf&quot;, &amp;cost); + if (cost &lt;= 2000) + amt = cost * 0.94; + else if (cost &gt; 2000 &amp;&amp; cost &lt;= 5000) + amt = cost * 0.9; + else if (cost &gt; 5000 &amp;&amp; cost &lt;= 10000) + amt = cost * 0.85; + else if (cost &gt; 10000) + amt = cost * 0.8; + printf(&quot;\nAmount to be paid : %g&quot;, amt); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P024-c', 'P024.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P024.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P024.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P024.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P024-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to check whether a year is leapyear or not. */ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +int main() +{ + int year; + printf(&quot;Enter the year : &quot;); + scanf(&quot;%d&quot;, &amp;year); + if (year % 4 == 0 &amp;&amp; year % 100 != 0) + printf(&quot;\nYear %d is a leapyear.&quot;, year); + else if (year % 400 == 0) + printf(&quot;\nYear %d is a leapyear (Century).&quot;, year); + else + printf(&quot;\nYear %d is not a leapyear.&quot;, year); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P025-c', 'P025.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P025.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P025.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P025.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P025-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input the electricity unit consumed and calculate the total +bill amount according to the given condition : + for 1st 50 unit Rs. 0.50 per unit + next 100 unit Rs. 0.75 per unit + next 100 unit Rs. 1.20 per unit + above 250 unit Rs. 1.50 per unit +And additional charge of 20 percent is added to the bill. +*/ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +int main() +{ + double unit, amt; + printf(&quot;Enter the electricity consp(unit) : &quot;); + scanf(&quot;%lf&quot;, &amp;amt); + if (unit &lt;= 50) + amt = unit * 0.50; + else if (unit &gt; 50 &amp;&amp; unit &lt;= 50) + amt = 25 + ((unit - 50) * 0.75); + else if (unit &gt; 150 &amp;&amp; unit &lt;= 250) + amt = 25 + 75 + ((unit - 150) * 1.20); + else if (unit &gt; 250) + amt = 25 + 75 + 120 + ((unit - 250) * 1.50); + amt = amt * 1.20; + printf(&quot;\nAmount to be paid : %g&quot;, amt); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P026-c', 'P026.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P026.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P026.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P026.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P026-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to input sum (p), rate of interest (r), time (t) and type of interest +(&#x27;s&#x27; for simple interest amd &#x27;c&#x27; for compound interest). Calculate and display +the interest earned + si = (p * r * t) / 100 + compoundInterest = p * ((1 + r / 100)^t - 1) +*/ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;ctype.h&gt; +int main() +{ + double principalAmount, rateOfInterest, timePeriod, simpleInterest, compoundInterest; + char mode; + printf(&quot;Enter the principle amount, Rate of interest, Time : &quot;); + scanf(&quot;%lf %lf %lf&quot;, &amp;principalAmount, &amp;rateOfInterest, &amp;timePeriod); + printf(&quot;\nEnter the mode (&#x27;s&#x27; : simple interest, &#x27;c&#x27; : compound interest) : &quot;); + scanf(&quot; %c&quot;, &amp;mode); + mode = tolower(mode); + switch (mode) + { + case &#x27;s&#x27;: + simpleInterest = (principalAmount * rateOfInterest * timePeriod) / 100; + printf(&quot;\nSimple Interest : %g&quot;, simpleInterest); + break; + case &#x27;c&#x27;: + compoundInterest = principalAmount * (pow((1 + rateOfInterest / 100), timePeriod) - 1); + printf(&quot;\nCompound Interest : %g&quot;, compoundInterest); + break; + default: + printf(&quot;\nInvalid Input&quot;); + return 1; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P027-c', 'P027.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P027.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P027.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P027.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P027-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Purchase Discount on Discount on + Amount Laptop Desktop + -------- ----------- ----------- + Upto 20k 3.0% 5.0% + 20001 - 50k 5.0% 7.5% + 50001 - 75k 7.5% 10.5% + more than 75k 10.0% 15.0% +WAP to input amount of purchase and type of purchase (&#x27;L&#x27; : laptop, &#x27;D&#x27; : desktop) +and display the discount amount and the discounted price (Net Amount). +*/ +/* Author - Amit Dutta, Date - 8th OCT, 2025 */ +// This code has not been compiled. +// If you find any issues, please create a new issue on GitHub regarding them. + +#include &lt;stdio.h&gt; +#include &lt;ctype.h&gt; +int main() +{ + double principal_amount, desktop_discount, laptop_discount, discount_amount, discounted_price; + char choice; + printf(&quot;Enter the purchase amount : &quot;); + scanf(&quot;%lf&quot;, &amp;principal_amount); + printf(&quot;Type of purchase (&#x27;L&#x27; : Laptop, &#x27;D&#x27; : Desktop) : &quot;); + scanf(&quot; %c&quot;, &amp;choice); + choice = toupper(choice); + if (principal_amount &lt;= 20000) + { + laptop_discount = 0.03; + desktop_discount = 0.05; + } + else if (principal_amount &gt; 20000 &amp;&amp; principal_amount &lt;= 50000) + { + laptop_discount = 0.05; + desktop_discount = 0.075; + } + else if (principal_amount &gt; 50000 &amp;&amp; principal_amount &lt;= 75000) + { + laptop_discount = 0.075; + desktop_discount = 0.105; + } + else if (principal_amount &gt; 75000) + { + laptop_discount = 0.1; + desktop_discount = 0.15; + } + switch (choice) + { + case &#x27;L&#x27;: + discount_amount = principal_amount * laptop_discount; + discounted_price = principal_amount - discount_amount; + printf(&quot;\nDiscount Amount : %g&quot; + &quot;\nDiscounted Price : %g&quot;, + discount_amount, discounted_price); + break; + case &#x27;D&#x27;: + discount_amount = principal_amount * desktop_discount; + discounted_price = principal_amount - discount_amount; + printf(&quot;\nDiscount Amount : %g&quot; + &quot;\nDiscounted Price : %g&quot;, + discount_amount, discounted_price); + break; + default: + printf(&quot;\nInvalid Input.&quot;); + return 1; + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P028-c', 'P028.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P028.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P028.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P028.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P028-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to calculate factorial of a number */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int i = 1, num, fact = 1; + printf(&quot;Enter the number : &quot;); + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + return 1; + } + if (num == 0) + { + printf(&quot;\nFactorial of 0 : 1&quot;); + return 0; + } + if (num &lt; 0) + { + printf(&quot;\nFactorial of %d : UNDEFINED&quot;, num); + return 0; + } + while (i &lt;= num) + { + fact = fact * i; + i++; + } + printf(&quot;Factorial of %d : %d&quot;, num, fact); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P029-c', 'P029.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P029.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P029.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P029.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P029-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ... */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int num, i = 0, result = 0; + printf(&quot;Enter the value for n : &quot;); + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nPlease enter a number.&quot;); + return 1; + } + if (num &lt; 1) + { + printf(&quot;\nPlease enter a positive number.&quot;); + return 1; + } + while (i &lt;= num) + { + result = result + i; + i++; + } + printf(&quot;\nResult : %d&quot;, result); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P030-c', 'P030.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P030.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P030.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P030.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P030-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Display the first 15 terms of the series. */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + int i, r; + + // 3, 6, 9, 12, ... + { + i = 3, r = 0; + printf(&quot;Series 1 (3, 6, 9, 12, ...) :&quot;); + while (i &lt;= 15) + { + r = r + 3; + printf(&quot; %d&quot;, r); + i++; + } + } + + // 1, 4, 9, 16, ... + { + i = 1; + printf(&quot;\nSeries 2 (1, 4, 9, 16, ...) :&quot;); + while (i &lt;= 15) + { + printf(&quot; %d&quot;, i * i); + i++; + } + } + + // 4, 8, 16, 32, ... + { + i = 1, r = 2; + printf(&quot;\nSeries 3 (4, 8, 16, 32, ...) :&quot;); + while (i &lt;= 15) + { + r = r * 2; + printf(&quot; %d&quot;, r); + i++; + } + } + + // 0, 7, 26, ... + { + i = 1, r; + printf(&quot;\nSeries 4 (0, 7, 26, ...) :&quot;); + while (i &lt;= 15) + { + r = (int)pow(i, 3) - 1; + printf(&quot; %d&quot;, r); + i++; + } + } + + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P031-c', 'P031.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P031.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P031.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P031.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P031-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Find the sum of the series */ +/* Author - Amit Dutta, Date - 11th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +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(&quot;--- s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10) ---&quot;); + printf(&quot;\nEnter the number : &quot;); + scanf(&quot;%lf&quot;, &amp;a); + while (i &lt;= 10) + { + res = res + ((a * a) / i); + i++; + } + printf(&quot;S = %g&quot;, res); + } + + // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n + { + res = 0, i = 0; + printf(&quot;\n--- // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n ---&quot;); + printf(&quot;\nEnter the value for a and n : &quot;); + scanf(&quot; %lf %lf&quot;, &amp;a, &amp;n); + while (i &lt;= n - 1) + { + res = res + (pow(i + 1, i + 1) / pow(a, i)); + i++; + } + printf(&quot;S = %g&quot;, res); + } + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P032-c', 'P032.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P032.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P032.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P032.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P032-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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 &lt;stdio.h&gt; +int main() +{ + int n, temp, sod = 0; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + temp = n; + while (temp &gt; 0) + { + sod = sod + (temp % 10); + temp = temp / 10; + } + if (n % sod == 0) + printf(&quot;\nIt is Niven number.&quot;); + else + printf(&quot;\nIt is not a Niven number.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P033-c', 'P033.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P033.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P033.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P033.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P033-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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 &lt;stdio.h&gt; +int main() +{ + int inp, odd = 0, even = 0, temp; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;inp); + temp = inp; + while (temp &gt; 0) + { + if ((temp % 10) % 2 == 0) + even += temp % 10; + else + odd += temp % 10; + temp /= 10; + } + printf(&quot;\nSum of even : %d&quot; + &quot;\nSum of odd : %d&quot;, + even, odd); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P034-c', 'P034.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P034.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P034.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P034.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P034-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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 &lt;stdio.h&gt; +int main() +{ + int inp, temp, index = 1, even = 0, odd = 0; + printf(&quot;Enter the numebr : &quot;); + scanf(&quot;%d&quot;, &amp;inp); + temp = inp; + while (temp &gt; 0) + { + if (index % 2 == 0) + even += temp % 10; + else + odd += temp % 10; + temp /= 10; + index++; + } + printf(&quot;\nSum of even position digits : %d&quot; + &quot;\nSum of odd position digits : %d&quot;, + even, odd); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P035-c', 'P035.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P035.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P035.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P035.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P035-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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 &lt;stdio.h&gt; +#include &lt;stdbool.h&gt; +int main() +{ + int n, res = 1, temp; + bool status = false; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + temp = n; + while (temp &gt; 0) + { + if ((temp % 10) % 2 == 0) + { + res *= (temp % 10) + 1; + status = true; + } + temp /= 10; + } + if (!status) + printf(&quot;\nThere is no even digits.&quot;); + else + printf(&quot;\nThe product of the successors of even digits of the number %d is : %d&quot;, n, res); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P036-c', 'P036.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P036.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P036.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P036.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P036-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */ +/* Author - Amit Dutta, Date - 18th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + double a, sum = 0; + int n, i; + printf(&quot;Enter value for a and n : &quot;); + scanf(&quot;%lf %d&quot;, &amp;a, &amp;n); + for (i = 1; i &lt;= n; i++) + sum += pow(a, i) / i; + printf(&quot;\nSum = %g&quot;, sum); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P037-c', 'P037.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P037.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P037.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P037.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P037-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* 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 &lt;stdio.h&gt; + +int main() +{ + double sum = 0, temp1 = 0, temp2 = 1; + int n, i; + printf(&quot;Enter value for n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + temp1 += i; + temp2 *= i; + sum += temp1 / temp2; + } + printf(&quot;\nSum = %g&quot;, sum); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P038-c', 'P038.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P038.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P038.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P038.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P038-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check prime number */ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;stdbool.h&gt; + +int main() +{ + int num, i, endCheckDigit; + bool isPrime = true; + printf(&quot;Enter the number : &quot;); + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nOnly a number is allowed, not a character.&quot;); + return 1; + } + if (num &lt;= 0) + { + printf(&quot;\nOnly postive number is allowed.&quot;); + return 1; + } + if (num == 1) + { + printf(&quot;\nInput 1 is not a prime number.&quot; + &quot;\nHas only one positive divisor (itself), not exactly two.&quot; + &quot;\nRule: Prime number should have exactly two distinct positive divisors: 1 and itself&quot;); + return 0; + } + if (num == 2) + { + printf(&quot;\nInput 2 is a prime number.&quot; + &quot;\n(Note: 2 is only Even Prime Number)&quot;); + return 0; + } + if (num % 2 == 0) + { + printf(&quot;\nInput %d is not a prime number.&quot;, num); + return 0; + } + endCheckDigit = sqrt(num); + for (i = 3; i &lt;= endCheckDigit; i += 2) + { + if (num % i == 0) + { + isPrime = false; + printf(&quot;\nInput %d is not prime number.&quot;, num); + return 0; + } + } + if (isPrime) + { + printf(&quot;\nInput %d is a prime number.&quot;, num); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P039-c', 'P039.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P039.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P039.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P039.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P039-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to print all the factors of a postive integer */ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int num, i; + printf(&quot;Enter a number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + printf(&quot;\nFactors of %d : &quot;, num); + for (i = 1; i &lt;= num / 2; i++) + { + if (num % i == 0) + { + printf(&quot; %d&quot;, i); + } + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P040-c', 'P040.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P040.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P040.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P040.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P040-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to calculate HCF of two positive number */ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int a, b, temp; + printf(&quot;Enter two number : &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + while (b &gt; 0) + { + temp = a; + a = b; + b = temp % b; + } + printf(&quot;HCF = %d&quot;, a); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P041-c', 'P041.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P041.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P041.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P041.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P041-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to enter two numbers and check they are co-prime or not. + co-prime when HCF = 1 +*/ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int a, b, temp, temp_a, temp_b; + printf(&quot;Enter two number : &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, %d) is co-prime.&quot;, temp_a, temp_b); + } + else + { + printf(&quot;\n(%d, %d) is not co-prime.&quot;, temp_a, temp_b); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P042-c', 'P042.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P042.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P042.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P042.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P042-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to accept a number and check whether the number +is twisted prime or not. */ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + int n, t, i, r, rev, prime = 1; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 2; i &lt;= (int)sqrt(n); i++) + { + if (n % i == 0) + { + prime = 0; + break; + } + } + if (prime) + { + printf(&quot;%d is a prime number.&quot;, n); + t = n; + rev = 0; + prime = 1; + while (t &gt; 0) + { + r = t % 10; + rev = rev * 10 + r; + t = t / 10; + } + for (i = 2; i &lt;= (int)sqrt(rev); i++) + { + if (rev % i == 0) + { + prime = 0; + break; + } + } + if (prime) + { + printf(&quot;\n%d and %d are prime numbers.. TWISTED PRIME&quot;, n, rev); + } + else + { + printf(&quot;\n%d is non prime&quot;, rev); + } + } + else + { + printf(&quot;\n%d is non prime.&quot;, n); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P043-c', 'P043.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P043.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P043.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P043.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P043-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to check palindrome number. */ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +#include &lt;stdio.h&gt; +int main() +{ + int num, temp, rev; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + temp = num; + rev = 0; + while (temp &gt; 0) + { + rev = (rev * 10) + (temp % 10); + temp /= 10; + } + if (num == rev) + { + printf(&quot;%d is a palindrome number.&quot;, num); + } + else + { + printf(&quot;%d is not a palindrome number.&quot;, num); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P044-c', 'P044.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P044.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P044.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P044.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P044-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to input a number and check whether the +number is Pronic number or not. + Pronic Number: The number which is the product of two numbers + which is the product of two consecutive integer. + Ex: 20 = 4 * 5 +*/ +/* Author - Amit Dutta, Date - 27th OCT, 2025 */ + +// using boolean... +/* +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; +#include &lt;stdbool.h&gt; + +int main() +{ + int num, iterationIndex; + bool isPronic = false; + printf(&quot;Enter the number : &quot;); + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nYou have to enter a number, not an character or symbol.&quot;); + return 1; + } + if (num &lt; 1) + { + printf(&quot;\nOnly postive number is allowed.&quot;); + return 1; + } + for (iterationIndex = 1; iterationIndex &lt;= num / 2; iterationIndex++) + { + if (iterationIndex * (iterationIndex + 1) == num) + { + printf(&quot;\nInput %d is a Pronic Number.&quot;, num); + isPronic = true; + break; + } + } + if(!isPronic) + { + printf(&quot;\nInput %d is not a Pronic Number.&quot;, num); + } + return 0; +} +*/ + +// using direct return method (more efficient and generally preferred)... + +#include &lt;stdio.h&gt; +#include &lt;math.h&gt; + +int main() +{ + int num, iterationIndex, iterationLimit; + printf(&quot;Enter the number : &quot;); + if (scanf(&quot;%d&quot;, &amp;num) != 1) + { + printf(&quot;\nYou have to enter a number, not an character or symbol.&quot;); + return 1; + } + if (num &lt; 1) + { + printf(&quot;\nOnly postive number is allowed.&quot;); + return 1; + } + iterationLimit = (int)sqrt(num); + for (iterationIndex = 1; iterationIndex &lt;= iterationLimit; iterationIndex++) + { + if (iterationIndex * (iterationIndex + 1) == num) + { + printf(&quot;\nInput %d is a Pronic Number.&quot;, num); + return 0; + } + } + printf(&quot;\nInput %d is not a Pronic Number.&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P045-c', 'P045.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P045.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P045.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P045.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P045-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Make this pattern for input n. + Pattern : + 1 + 1 2 + 1 2 3 + 1 2 3 4 + 1 2 3 4 5 +*/ +/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, n; + printf(&quot;Enter n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + for (j = 1; j &lt;= i; j++) + { + printf(&quot;%d\t&quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P046-c', 'P046.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P046.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P046.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P046.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P046-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Make this pattern for input n. + Pattern : + 1 + 2 1 + 3 2 1 + 4 3 2 1 + 5 4 3 2 1 +*/ +/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, n; + printf(&quot;Enter n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + for (j = i; j &gt;= 1; j--) + { + printf(&quot;%d\t&quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P047-c', 'P047.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P047.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P047.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P047.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P047-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Make this pattern for input n. + Pattern : + 5 + 5 4 + 5 4 3 + 5 4 3 2 + 5 4 3 2 1 +*/ +/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, n; + printf(&quot;Enter n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = n; i &gt;= 1; i--) + { + for (j = n; j &gt;= i; j--) + { + printf(&quot;%d\t&quot;, j); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P048-c', 'P048.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P048.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P048.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P048.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P048-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Make this pattern for input n no of row. + Pattern : + 1 + 2 3 + 4 5 6 + 7 8 9 10 + 11 12 13 14 15 +*/ +/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, n, temp = 1; + printf(&quot;Enter row number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + for (j = 1; j &lt;= i; j++) + { + printf(&quot;%d\t&quot;, temp); + temp++; + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P049-c', 'P049.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P049.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P049.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P049.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P049-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Make this pattern for input n no of row. + Pattern : + # + @ @ + # # # + @ @ @ @ + # # # # # + */ +/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */ + +#include &lt;stdio.h&gt; + +int main() +{ + int i, j, n; + char a = &#x27;#&#x27;, b = &#x27;@&#x27;; + printf(&quot;Enter row number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + for (j = 1; j &lt;= i; j++) + { + if (i % 2 == 0) + printf(&quot;%c\t&quot;, b); + else + printf(&quot;%c\t&quot;, a); + } + printf(&quot;\n&quot;); + } + return 0; +} +</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P050-SHORT-c', 'P050-SHORT.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050-SHORT.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P050-SHORT.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050-SHORT.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P050-SHORT-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to input a number and check whether it is Disarium Number or not. + Note : A number is said to Disarium if sum of its digit powered by with their + respective position is equal to the original number. */ +/* Author - Amit Dutta, Date - 08th November, 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; +#include &lt;math.h&gt; + +int main() +{ + int num; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + int position = printf(&quot;%d&quot;, num); + int temp = num; + int res = 0; + while (temp &gt; 0) + { + res += (int)pow(temp % 10, position); + position--; + temp /= 10; + } + if (res == num) + printf(&quot; is a Disarium Number.&quot;); + else + printf(&quot; is Not a Disarium Number.&quot;); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P050-c', 'P050.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P050.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P050.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P050-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to input a number and check whether it is Disarium Number or not. + Note : A number is said to Disarium if sum of its digit powered by with their + respective position is equal to the original number. */ +/* Author - Amit Dutta, Date - 08th November, 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; +#include &lt;math.h&gt; + +int main() +{ + int num, res = 0, temp, position = 0; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;num); + temp = num; + while (temp &gt; 0) + { + position++; + temp /= 10; + } + temp = num; + while (temp &gt; 0) + { + res += (int)pow(temp % 10, position); + position--; + temp /= 10; + } + if (res == num) + printf(&quot;\nInput %d is a Disarium Number.&quot;, num); + else + printf(&quot;\nInput %d is Not a Disarium Number.&quot;, num); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P051-c', 'P051.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P051.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P051.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P051.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P051-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to input two number and check whether they are Amicable Pair or not + Example : Sum of Proper Divisors of 220 (1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110) = 284 + Sum of Proper Divisors of 284 (1, 2, 4, 71, 142) = 220 */ +/* Author - Amit Dutta, Date - 09th November, 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() +{ + int a, b, i, sa = 0, sb = 0; + printf(&quot;Enter two number : &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + for (i = 1; i &lt;= a / 2; i++) + if (a % i == 0) + sa += i; + for (i = 1; i &lt;= b / 2; i++) + if (b % i == 0) + sb += i; + if (sa == b &amp;&amp; sb == a) + printf(&quot;\nInput %d and %d is Amicable Pair.&quot;, a, b); + else + printf(&quot;\nInput %d and %d is Not Amicable Pair.&quot;, a, b); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P052-c', 'P052.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P052.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P052.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P052.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P052-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Print the sum of this series for upto n element. + Series: 1 + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + ... + (1 + 2 + 3 + ... + n) */ +/* Author - Amit Dutta, Date - 09th November, 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() +{ + int n, sum = 0, temp = 0, i; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + for (i = 1; i &lt;= n; i++) + { + temp += i; + sum += temp; + } + printf(&quot;%d&quot;, sum); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P053-c', 'P053.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P053.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P053.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P053.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P053-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Print all pattern */ +/* Author - Amit Dutta, Date - 09th November, 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() +{ + int i, j, temp; + + printf(&quot;\n\nPattern 1 : \n\n&quot;); + /* + 9 9 9 9 9 + 7 7 7 7 7 + 5 5 5 5 5 + 3 3 3 3 3 + 1 1 1 1 1 + */ + temp = 9; + for (i = 1; i &lt;= 5; i++) + { + for (j = 1; j &lt;= 5; j++) + { + printf(&quot;%d &quot;, temp); + } + printf(&quot;\n&quot;); + temp -= 2; + } + + // Another method print above pattern + printf(&quot;\n\nPattern 1 : \n\n&quot;); + for (i = 9; i &gt;= 1; i -= 2) + { + for (j = 1; j &lt;= 5; j++) + { + printf(&quot;%d &quot;, i); + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 2 : \n\n&quot;); + /* + 1 2 3 4 5 + 1 2 3 4 5 + 1 2 3 4 5 + */ + for (i = 1; i &lt;= 3; i++) + { + for (j = 1; j &lt;= 5; j++) + { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 3 : \n\n&quot;); + /* + 5 4 3 2 1 + 5 4 3 2 1 + */ + for (i = 1; i &lt;= 2; i++) + { + for (j = 5; j &gt;= 1; j--) + { + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 4 : \n\n&quot;); + /* + 1 2 3 4 + 5 6 7 8 + 9 10 11 12 + */ + temp = 1; + for (i = 1; i &lt;= 3; i++) + { + for (j = 1; j &lt;= 4; j++) + { + printf(&quot;%d &quot;, temp); + temp++; + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 5 : \n\n&quot;); + /* + 1 2 3 4 + 4 8 12 16 + 1 2 3 4 + 4 8 12 16 + 1 2 3 4 + */ + for (i = 1; i &lt;= 5; i++) + { + for (j = 1; j &lt;= 4; j++) + { + if (i % 2 == 0) + printf(&quot;%d &quot;, j * 4); + else + printf(&quot;%d &quot;, j); + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 6 : \n\n&quot;); + /* + 1 + 2 4 + 3 5 7 + 6 8 10 12 + 9 11 13 15 17 + */ + int odd = 1, even = 2; + for (i = 1; i &lt;= 5; i++) + { + for (j = 1; j &lt;= i; j++) + { + if (i % 2 == 0) + { + printf(&quot;%d &quot;, even); + even += 2; + } + else + { + printf(&quot;%d &quot;, odd); + odd += 2; + } + } + printf(&quot;\n&quot;); + } + + printf(&quot;\n\nPattern 7 : \n\n&quot;); + /* + 1 2 3 4 5 + 6 7 8 9 + 10 11 12 + 13 14 + 15 + */ + temp = 1; + for (i = 5; i &gt;= 1; i--) + { + for (j = 1; j &lt;= i; j++) + { + printf(&quot;%d &quot;, temp); + temp++; + } + printf(&quot;\n&quot;); + } + + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P054-c', 'P054.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P054.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P054.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P054.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P054-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* WAP to check Krishnamurty number using user defined methods/functions. */ +/* Author - Amit Dutta, Date - 15th November, 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 fact(int); +int isKrishnamurty(int); + +int fact(int n) +{ + int fact = 1, i; + for (i = 1; i &lt;= n; i++) + fact *= i; + return fact; +} + +int isKrishnamurty(int n) +{ + int temp = n, sum = 0; + while (temp &gt; 0) + { + sum += fact(temp % 10); + temp /= 10; + } + return n == sum; +} + +int main() +{ + int n; + printf(&quot;Enter the number : &quot;); + scanf(&quot;%d&quot;, &amp;n); + if (isKrishnamurty(n)) + printf(&quot;\nInput %d is a Krishnamurty Number.&quot;, n); + else + printf(&quot;\nInput %d is not a Krishnamurty number.&quot;, n); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P055-c', 'P055.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P055.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P055.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P055.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P055-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to print n terms of Fibbonacci Series (Starting from term 0) */ +/* Author - Amit Dutta, Date - 15th November, 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; + +void printFibonacci(int); + +void printFibonacci(int n) +{ + int val1 = 0, val2 = 1, val3, i; + printf(&quot;\nFibonacci series upto %d terms :&quot;, n); + if (n &lt; 0) + printf(&quot; N/A&quot;); + if (n == 0) + printf(&quot; %d&quot;, val1); + if (n &gt; 0) + printf(&quot; %d %d&quot;, val1, val2); + for (i = 2; i &lt;= n; i++) + { + val3 = val1 + val2; + printf(&quot; %d&quot;, val3); + val1 = val2; + val2 = val3; + } +} + +int main() +{ + int n; + printf(&quot;Enter the n : &quot;); + scanf(&quot;%d&quot;, &amp;n); + printFibonacci(n); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P056-c', 'P056.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P056.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P056.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P056.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P056-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to swap the value of a and b using user defined method. */ +/* Author - Amit Dutta, Date - 22th November, 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; + +void swap(int *a, int *b) +{ + int temp = *a; + *a = *b; + *b = temp; +} + +int main() +{ + int a, b; + printf(&quot;Enter A and B: &quot;); + scanf(&quot;%d %d&quot;, &amp;a, &amp;b); + printf(&quot;\nBefore swap A: %d, B: %d&quot;, a, b); + swap(&amp;a, &amp;b); + printf(&quot;\nAfter swap A: %d, B: %d&quot;, a, b); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P057-c', 'P057.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P057.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P057.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P057.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P057-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to display the series using user defined method. + 0, 7, 26, 63, ... upto n terms using void series(int n) +*/ +/* Author - Amit Dutta, Date - 22th November, 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; + +void series(int n) +{ + int i; + printf(&quot;\nSeries: &quot;); + for (i = 1; i &lt;= n; i++) + printf(&quot;%d &quot;, (i * i * i) - 1); +} + +int main() +{ + int n; + printf(&quot;Enter n: &quot;); + scanf(&quot;%d&quot;, &amp;n); + series(n); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P058-c', 'P058.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P058.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P058.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P058.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P058-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* WAP to display ASCII code of Alphabets (A - Z) using void displayASCII() */ +/* Author - Amit Dutta, Date - 22th November, 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; + +void displayASCII() +{ + int i; + printf(&quot;ASCII Code\t\tCharacter&quot;); + for (i = &#x27;A&#x27;; i &lt;= &#x27;Z&#x27;; i++) + printf(&quot;\n%c\t\t%d&quot;, i, i); +} + +int main() +{ + displayASCII(); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P059-c', 'P059.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P059.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P059.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P059.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P059-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 12 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to find the sum of array elements using following fuctions + int array_sum(int a[], int n); + void get_data(int a[], int n); + voidd dispaly(int a[], int n); +*/ +/* Author - Amit Dutta, Date - 29th November, 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 array_sum(int[], int); +void get_data(int[], int); +void display(int[], int); + +int main() +{ + int size, arr[20]; + printf(&quot;How many element do you want to add (Max: 20): &quot;); + scanf(&quot;%d&quot;, &amp;size); + if (size &lt; 1 &amp;&amp; size &gt; 20) + { + printf(&quot;\nMax Element count is 20.&quot;); + return 1; + } + get_data(arr, size); + display(arr, size); + printf(&quot;\nSum of the elements is: %d&quot;, array_sum(arr, size)); + return 0; +} + +void get_data(int a[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element for position %d: &quot;, i); + scanf(&quot;%d&quot;, &amp;a[i]); + } +} + +void display(int a[], int n) +{ + int i; + printf(&quot;\nArray: [&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot;%d&quot;, a[i]); + if (i != n - 1) + printf(&quot;, &quot;); + } + printf(&quot;]\n&quot;); +} + +int array_sum(int a[], int n) +{ + int i, sum = 0; + for (i = 0; i &lt; n; i++) + sum += a[i]; + return sum; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P060-c', 'P060.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P060.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P060.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P060.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P060-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 13 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* write a C program to count the occurrences of a given element in an array using a user-defined +function. Create a function int count_occurrences(int arr[], int n, int target) that countts how +many times target appears in the array. */ + +#include &lt;stdio.h&gt; + +int count_occurrences(int[], int, int); +void inputarr(int[], int); + +int main() +{ + int n, arr[20], target, found; + printf(&quot;Enter the n (Max: 20): &quot;); + scanf(&quot;%d&quot;, &amp;n); + inputarr(arr, n); + printf(&quot;Enter the target: &quot;); + scanf(&quot;%d&quot;, &amp;target); + found = count_occurrences(arr, n, target); + if (found) + { + printf(&quot;\n%d found %d times.&quot;, target, found); + } + else + { + printf(&quot;\n%d is not found.&quot;, target); + } + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int count_occurrences(int arr[], int n, int target) +{ + int count = 0; + int i; + for (i = 0; i &lt; n; i++) + { + if (arr[i] == target) + { + count++; + } + } + return count; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P061-c', 'P061.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P061.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P061.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P061.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P061-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Dec 2025 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program to find the sum of even elements in an array using a user defined function. +Define a functions int sumEven(int arr[], int n) that returns the sum of all even elements in the array. */ + +#include &lt;stdio.h&gt; + +void inputarr(int[], int); +int sumEven(int[], int); + +int main() +{ + int arr[20], n; + printf(&quot;Enter the n (Max: 20): &quot;); + scanf(&quot;%d&quot;, &amp;n); + inputarr(arr, n); + printf(&quot;\nSum of the even number in the array: %d&quot;, sumEven(arr, n)); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int sumEven(int arr[], int n) +{ + int i, sum_even = 0; + for (i = 0; i &lt; n; i++) + { + if (arr[i] % 2 == 0) + { + sum_even += arr[i]; + } + } + return sum_even; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P062-c', 'P062.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P062.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P062.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P062.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P062-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 16 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program to find the smallest and largest in an array using user-defined functions. +Define two functions int findSmallest(int arr[], int n) and int findLargest(int arr[], int n) that +return the smallest and largest elements in an array, respectively. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputarr(int[], int); +int findSmallest(int[], int); +int findLargest(int[], int); + +int main() +{ + int n, *arr; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;n); + arr = (int *)malloc(n * sizeof(int)); + inputarr(arr, n); + printf(&quot;\nSmallest element = %d&quot;, findSmallest(arr, n)); + printf(&quot;\nLargest element = %d&quot;, findLargest(arr, n)); + free(arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter Element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int findSmallest(int arr[], int n) +{ + int i, smallest = arr[0]; + for (i = 1; i &lt; n; i++) + { + if (smallest &gt; arr[i]) + { + smallest = arr[i]; + } + } + return smallest; +} + +int findLargest(int arr[], int n) +{ + int i, largest = arr[0]; + for (i = 1; i &lt; n; i++) + { + if (largest &lt; arr[i]) + { + largest = arr[i]; + } + } + return largest; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P063-c', 'P063.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P063.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P063.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P063.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P063-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 16 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a C program to find all Niven in an array. Define a user-defined function int isNiven(int num) +that returns 1 if the numbers is a Niven number, otherwise returns 0. A Niven number (also known as a +Harshad Number) is an integer that is divisible by the sum of its digits. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void inputarr(int[], int); +int isNiven(int); + +int main() +{ + int n, *arr, i; + printf(&quot;How many element do you want to enter: &quot;); + scanf(&quot;%d&quot;, &amp;n); + arr = (int *)malloc(n * sizeof(int)); + inputarr(arr, n); + for (i = 0; i &lt; n; i++) + { + if (isNiven(arr[i])) + { + printf(&quot;\n%d is a Niven number.&quot;, arr[i]); + } + else + { + printf(&quot;\n%d is a NOT Niven number.&quot;, arr[i]); + } + } + free(arr); + return 0; +} + +void inputarr(int arr[], int n) +{ + int i; + for (i = 0; i &lt; n; i++) + { + printf(&quot;Enter Element %d: &quot;, i + 1); + scanf(&quot;%d&quot;, &amp;arr[i]); + } +} + +int isNiven(int num) +{ + int i, sum = 0, temp = num; + while (temp &gt; 0) + { + sum += temp % 10; + temp /= 10; + } + return num % sum == 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P064-c', 'P064.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P064.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P064.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P064.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P064-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 21 Dec 2025 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2025 Amit Dutta + */ + +/* Write a program to merge two sorted integer arrays to form a single sorted array. */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +void merge(int[], int, int[], int); + +int main() +{ + int a[] = {10, 30, 50, 70, 90}; + int b[] = {20, 40, 60, 80, 100}; + int n1 = sizeof(a) / sizeof(a[0]); + int n2 = sizeof(b) / sizeof(b[0]); + merge(a, n1, b, n2); + return 0; +} + +void merge(int a[], int n1, int b[], int n2) +{ + int n = n1 + n2; + int *c = (int *)malloc(n * sizeof(int)); + int i, j, k; + i = j = k = 0; + while (i &lt; n1 &amp;&amp; j &lt; n2) + { + if (a[i] &lt; b[j]) + { + c[k++] = a[i++]; + } + else + { + c[k++] = b[j++]; + } + } + while (i &lt; n1) + { + c[k++] = a[i++]; + } + while (j &lt; n2) + { + c[k++] = b[j++]; + } + printf(&quot;Merged Array:&quot;); + for (i = 0; i &lt; n; i++) + { + printf(&quot; %d&quot;, c[i]); + } + free(c); +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P065-c', 'P065.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P065.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P065.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P065.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P065-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to reverse a string */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; +#include &lt;string.h&gt; + +void str_rev(char[]); + +int main() +{ + char str[101]; + printf(&quot;Enter the string (Max: 100 Character): &quot;); + gets(str); + printf(&quot;\nBefore Reverse: %s&quot;, str); + str_rev(str); + printf(&quot;\nAfter Reverse: %s&quot;, str); + return 0; +} + +void str_rev(char str[]) +{ + int i, j; + char temp; + i = 0; + j = strlen(str) - 1; // not taking the null + while (i &lt; j) + { + temp = str[i]; + str[i] = str[j]; + str[j] = temp; + i++; + j--; + } +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P066-c', 'P066.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P066.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P066.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P066.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P066-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* WAP to find the length of a string using + i) Library Method + ii) User defined method +*/ + +#include &lt;stdio.h&gt; +#include &lt;string.h&gt; + +int sLength(char str[]) +{ + int i = 0; + while (str[i] != &#x27;\0&#x27;) + { + i++; + } + return i; +} + +int main() +{ + char str[30]; + int len; + printf(&quot;Enter the string: &quot;); + gets(str); + len = strlen(str); + printf(&quot;Length of the string: %d&quot;, len); + printf(&quot;\nLength of the string (U-D): %d&quot;, len); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P067-c', 'P067.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P067.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P067.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P067.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P067-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a program using function which concatenates two string s1 and s2 in to a third string */ + +#include &lt;stdio.h&gt; + +void string_concat(char *s3, char s1[], char s2[]) +{ + int l1, l2, i, j, k; + i = j = k = 0; + l1 = strlen(s1); + l2 = strlen(s2); + s3 = (char *)malloc((l1 + l2 + 1) * sizeof(char)); + while (s1[i] != &#x27;\0&#x27;) + { + s3[k++] = s1[i++]; + } + while (s2[j] != &#x27;\0&#x27;) + { + s3[k++] = s2[j++]; + } + s3[k] = &#x27;\0&#x27;; + puts(s3); +} + +int main() +{ + char s1[] = &quot;JAVA&quot;; + char s2[] = &quot;PYTHON&quot;; + char *s3 = NULL; + string_concat(s3, s1, s2); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P068-c', 'P068.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P068.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P068.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P068.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P068-c" style="display:none;">/* + * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 14 Jan 2026 + * Repo: https://github.com/notamitgamer/bsc + * License: MIT | Copyright (c) 2026 Amit Dutta + */ + +/* Write a c program that perform the operation of strcmp() */ + +#include &lt;stdio.h&gt; +#include &lt;stdlib.h&gt; + +int string_compare1(char s1[], char s2[]) +{ + int i, c, cmp = 0, p = 0; + i = 0; + while (s1[i] != &#x27;\0&#x27; &amp;&amp; s2[i] != &#x27;\0&#x27;) + { + if (s1[i] != s2[i]) + { + cmp = s1[i] - s2[i]; + p = 1; + break; + } + i++; + } + c = s1[i] != &#x27;\0&#x27; ? s1[i] : (-1) * s2[i]; + return p == 1 ? cmp : c; +} +int string_compare2(char *s1, char *s2) +{ + while (*s1 != &#x27;\0&#x27; &amp;&amp; (*s1 == *s2)) + { + s1++; + s2++; + } + return *s1 - *s2; +} + +int main() +{ + char str1[] = &quot;AMIT&quot;; + char str2[] = &quot;Amit&quot;; + printf(&quot;Result 1 = %d&quot;, string_compare1(str1, str2)); + printf(&quot;\nResult 2 = %d&quot;, string_compare2(str1, str2)); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P069-c', 'P069.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P069.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P069.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P069.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P069-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 14 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program using user defined method to implement the following + JAVA PROG Mastery -&gt; JPM + java prog mastery -&gt; JPM + Acharya Prafulla Chandra -&gt; JPM +*/ + +#include &lt;stdio.h&gt; +#include &lt;ctype.h&gt; + +void _short_1(char str[]) +{ + int i = 0, j = 0; + char s[10]; + if (str[0] != &#x27;\0&#x27; &amp;&amp; str[0] != &#x27; &#x27;) + { + s[j] = toupper(str[j]); + i++; + j++; + } + while (str[i] != &#x27;\0&#x27;) + { + if (str[i] == &#x27; &#x27;) + { + s[j] = toupper(str[i + 1]); + i++; + j++; + } + i++; + } + s[j] = &#x27;\0&#x27;; + printf(&quot;\nResult 1: %s&quot;, s); +} + +void _short_2(char str[]) +{ + int i, j; + char strnew[10]; + strnew[0] = toupper(str[0]); + i = j = 1; + while (str[i] != &#x27;\0&#x27;) + { + if (str[i] == &#x27; &#x27;) + { + strnew[j++] = toupper(str[i + 1]); + } + i++; + } + strnew[j] = &#x27;\0&#x27;; + printf(&quot;\nResult 2: %s&quot;, strnew); +} + +int main() +{ + char str[30]; + printf(&quot;Enter the string: &quot;); + gets(str); + _short_1(str); + _short_2(str); + return 0; +}</div> + </div> + + <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> + <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-tuition-c-P070-c', 'P070.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P070.c')"> + <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">P070.c</span> + </div> + <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> + <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/tuition-c/P070.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> + <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + <!-- Embedded Code Storage --> + <div id="code-Semester_1-tuition-c-P070-c" style="display:none;">/* + * Author : Amit Dutta &lt;amitdutta4255@gmail.com&gt; + * Date : 24 Jan 2026 + * Repo : https://github.com/notamitgamer/bsc + * License : MIT License (See the LICENSE file for details) + * Copyright (c) 2026 Amit Dutta + */ + +/* Write a program to perform addition of two complex number having fields &#x27;real&#x27; and &#x27;img&#x27; +of type integer. */ + +#include &lt;stdio.h&gt; + +struct complex +{ + int real; + int img; +}; + +void getData(struct complex *c) +{ + printf(&quot;Enter real: &quot;); + scanf(&quot;%d&quot;, &amp;c-&gt;real); + printf(&quot;Enter imaginary: &quot;); + scanf(&quot;%d&quot;, &amp;c-&gt;img); +} + +struct complex add(struct complex c1, struct complex c2) +{ + struct complex r; + r.real = c1.real + c2.real; + r.img = c1.img + c2.img; + return r; +} + +void display(struct complex c) +{ + printf(&quot;%d+%di&quot;, c.real, c.img); +} + +int main() +{ + struct complex c1, c2, c3; + getData(&amp;c1); + getData(&amp;c2); + printf(&quot;\nComplex Number 1:\n&quot;); + display(c1); + printf(&quot;\nComplex Number 2:\n&quot;); + display(c2); + c3 = add(c1, c2); + printf(&quot;\nResult: \n&quot;); + display(c3); + return 0; +}</div> + </div> + + </div> + </div> + + </div> + </div> + + </div> + </div> + </div> + + <button id="back-to-top" onclick="scrollToTop()" class="hidden absolute bottom-6 right-6 p-3 bg-neutral-900 border border-neutral-700 text-lime-300 rounded-full shadow-lg hover:bg-lime-300 hover:text-black transition-all z-30"> + <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 10l7-7m0 0l7 7m-7-7v18"></path></svg> + </button> + </main> + </div> + + <!-- Code Viewer Modal --> + <div id="code-modal" class="fixed inset-0 bg-black/80 backdrop-blur-sm hidden flex items-center justify-center z-50 p-2 sm:p-6 opacity-0 transition-opacity duration-200"> + <div class="bg-[#0d1117] w-full max-w-6xl rounded-xl shadow-2xl flex flex-col border border-white/10 transform scale-95 transition-transform duration-200 modal-content-area"> + <!-- Modal Header --> + <div class="flex items-center justify-between px-3 sm:px-4 py-3 border-b border-white/10 bg-[#161b22] rounded-t-xl shrink-0 gap-2"> + <div class="flex items-center gap-3 overflow-hidden"> + <div class="flex gap-1.5 shrink-0 opacity-50"> + <div class="w-3 h-3 rounded-full bg-red-500"></div> + <div class="w-3 h-3 rounded-full bg-yellow-500"></div> + <div class="w-3 h-3 rounded-full bg-green-500"></div> + </div> + <div class="flex flex-col min-w-0"> + <h3 id="modal-filename" class="text-xs sm:text-sm font-mono text-lime-300 truncate font-medium">filename.c</h3> + <span id="modal-filesize" class="text-[10px] text-neutral-500 font-mono"></span> + </div> + </div> + + <div class="flex items-center gap-1 sm:gap-2 shrink-0 relative"> + + <!-- Desktop Buttons Group --> + <div class="hidden sm:flex items-center gap-1 sm:gap-2"> + <button id="new-tab-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Open in New Tab"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /></svg> + </button> + + <!-- Compiler Button --> + <button onclick="openInCompiler()" class="p-2 text-neutral-400 hover:text-lime-300 hover:bg-lime-300/10 rounded-lg transition-all group relative" title="Open in C Compiler"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> + </svg> + </button> + + <button id="download-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Download File"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> + </button> + + <button id="print-btn" onclick="printCode()" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Print Code"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" /></svg> + </button> + + <button id="share-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Copy Link"> + <svg id="share-icon-default" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" /></svg> + <svg id="share-icon-success" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300 hidden transform scale-0 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> + </button> + + <button id="copy-code-btn" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-all group relative" title="Copy Code"> + <svg id="copy-icon-default" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> + <svg id="copy-icon-success" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300 hidden transform scale-0 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> + </button> + + <a id="modal-raw-link" href="#" target="_blank" class="p-2 text-neutral-400 hover:text-white hover:bg-white/10 rounded-lg transition-colors" title="View Raw on GitHub"> + <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + </a> + </div> + + <!-- Mobile Menu Button --> + <button id="mobile-menu-btn" class="sm:hidden p-2 text-neutral-400 hover:text-white rounded-lg" onclick="toggleMobileMenu(event)"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" /> + </svg> + </button> + + <!-- Mobile Dropdown Menu --> + <div id="mobile-menu-dropdown" class="hidden absolute top-full right-0 mt-2 w-48 bg-[#161b22] border border-white/10 rounded-xl shadow-xl z-50 overflow-hidden font-mono text-sm"> + <button onclick="openInCompiler()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-lime-300 flex items-center gap-3 transition-colors border-b border-white/5"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg> + Compile / Run + </button> + <button onclick="document.getElementById('new-tab-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /></svg> + New Tab + </button> + <button onclick="document.getElementById('download-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> + Download + </button> + <button onclick="printCode()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" /></svg> + Print + </button> + <button onclick="document.getElementById('share-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" /></svg> + Share Link + </button> + <button onclick="document.getElementById('copy-code-btn').click()" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> + Copy Code + </button> + <a id="mobile-github-link" href="#" target="_blank" class="w-full text-left px-4 py-3 text-neutral-300 hover:bg-white/10 hover:text-white flex items-center gap-3 transition-colors border-t border-white/5"> + <svg class="h-4 w-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-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-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 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.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> + View on GitHub + </a> + </div> + + <!-- Close Button (Always Visible) --> + <button onclick="hideCode()" class="p-2 text-neutral-400 hover:text-white hover:bg-red-900/30 hover:text-red-400 rounded-lg transition-colors ml-1" title="Close"> + <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg> + </button> + </div> + </div> + + <!-- Code Content --> + <div class="flex-1 min-h-0 bg-[#0d1117] relative dark-modal-bg"> + <!-- Loading State --> + <div id="code-loading" class="absolute inset-0 flex items-center justify-center z-10 bg-[#0d1117] hidden"> + <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-lime-300"></div> + </div> + <!-- Code Container --> + <div id="modal-code-container" class="w-full h-full"> + <!-- CodeMirror is injected here --> + </div> + </div> + </div> + </div> + + <!-- License Modal --> + <div id="license-modal" class="fixed inset-0 bg-black/90 backdrop-blur-md hidden flex items-center justify-center z-[60] p-4 sm:p-6 opacity-0 transition-opacity duration-200"> + <div class="bg-[#111] w-full max-w-3xl rounded-xl shadow-2xl flex flex-col border border-neutral-800 transform scale-95 transition-transform duration-200 max-h-[85vh] sm:max-h-[85vh] max-h-[90vh]"> + <!-- Modal Header --> + <div class="flex items-center justify-between px-6 py-4 border-b border-neutral-800 shrink-0"> + <h3 class="text-lg font-bold text-white flex items-center gap-2 font-heading"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-lime-300" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /> + </svg> + License Information + </h3> + <div class="flex items-center gap-2"> + <a href="https://esal.amit.is-a.dev" target="_blank" class="p-2 text-neutral-500 hover:text-lime-300 hover:bg-lime-300/10 rounded-lg transition-colors" title="Download License PDF"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg> + </a> + <button id="license-close-btn" onclick="hideLicense()" class="p-2 text-neutral-500 hover:text-white hover:bg-neutral-800 rounded-lg transition-colors hidden"> + <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg> + </button> + </div> + </div> + + <!-- License Content --> + <div id="license-content" class="p-6 overflow-y-auto font-mono text-sm leading-relaxed text-neutral-400 bg-[#050505]"> + <div class="border-l-4 border-lime-300 pl-4 mb-6"> + <h4 class="font-bold text-white text-lg">EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)</h4> + <p class="text-lime-300/80 font-medium">Strict Non-Submission & Anti-Plagiarism Clause</p> + <p class="text-neutral-600 text-xs mt-1">Copyright (c) 2025, AMIT DUTTA. All Rights Reserved.</p> + </div> + + <div class="space-y-6"> + <div> + <h5 class="font-bold text-white mb-2">1. DEFINITIONS</h5> + <ul class="list-disc pl-5 space-y-1"> + <li><strong>"The Software":</strong> Refers to all code, documentation, logic, and assets contained within this repository.</li> + <li><strong>"The Author":</strong> Refers to Amit Dutta.</li> + <li><strong>"Academic Use":</strong> Refers to the submission of code for grading, credit, or requirement fulfillment at any educational institution (specifically including, but not limited to, West Bengal State University).</li> + </ul> + </div> + + <div> + <h5 class="font-bold text-white mb-2">2. TERMS OF ACCESS (BINDING AGREEMENT)</h5> + <p>By accessing, downloading, cloning, or forking this repository, you agree to be bound by the terms of this License. If you do not agree to these terms, you are not permitted to use or view the Software and must delete all copies immediately.</p> + </div> + + <div> + <h5 class="font-bold text-white mb-2">3. LIMITED GRANT OF RIGHTS (REFERENCE ONLY)</h5> + <p>The Author grants you a revocable, non-exclusive license to:</p> + <ul class="list-disc pl-5 mt-1 space-y-1"> + <li>Read and study the code for personal learning and skill development.</li> + <li>Compile and run the code locally for testing and educational analysis.</li> + <li>Reference the underlying logic to create your OWN original implementation.</li> + </ul> + </div> + + <div class="bg-red-900/10 border border-red-900/30 rounded p-4"> + <h5 class="font-bold text-red-500 mb-2 flex items-center gap-2"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" /></svg> + 4. STRICT PROHIBITIONS (THE "ANTI-PLAGIARISM" CLAUSE) + </h5> + <p class="text-red-400 mb-2">The rights granted in Section 3 are strictly conditional. You are EXPRESSLY PROHIBITED from:</p> + <ul class="list-disc pl-5 space-y-1 text-red-400"> + <li>Copying, pasting, or modifying this Software (in whole or in part) for submission as your own academic work (assignments, labs, projects).</li> + <li>Removing this license or the copyright headers from any file to conceal the code's origin.</li> + <li>Redistributing this code on other platforms without the Author's written consent.</li> + </ul> + <p class="font-bold text-red-500 mt-3 text-sm uppercase">ANY VIOLATION OF SECTION 4 CONSTITUTES A BREACH OF COPYRIGHT AND ACADEMIC MISCONDUCT.</p> + </div> + + <div> + <h5 class="font-bold text-white mb-2">5. ENFORCEMENT & REPORTING</h5> + <p>The Author reserves the right to employ software forensics (including Git history and commit timestamps) to establish original ownership. The Author reserves the right to forward evidence of unauthorized use and license violation to:</p> + <ul class="list-disc pl-5 mt-1 space-y-1"> + <li>The Department Head / Faculty of the relevant institution.</li> + <li>The Examination Controller of the relevant University.</li> + <li>GitHub Trust & Safety (for DMCA Takedown and account suspension).</li> + </ul> + </div> + + <div> + <h5 class="font-bold text-white mb-2">6. NO WARRANTY</h5> + <p class="text-xs uppercase">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. THE AUTHOR BEARS NO LIABILITY FOR ACADEMIC PENALTIES INCURRED BY USERS WHO VIOLATE THEIR INSTITUTION'S ACADEMIC INTEGRITY POLICIES BY USING THIS CODE.</p> + </div> + + <div> + <h5 class="font-bold text-white mb-2">7. GOVERNING LAW</h5> + <p>Any legal disputes regarding the ownership or misuse of this code shall be subject to the laws of India and the jurisdiction of West Bengal.</p> + </div> + </div> + </div> + + <!-- Modal Footer --> + <div id="license-footer" class="px-6 py-4 border-t border-neutral-800 bg-[#111] rounded-b-xl flex justify-end shrink-0 gap-3"></div> + </div> + </div> + + <!-- Confirm Dialog Modal --> + <div id="confirm-modal" class="fixed inset-0 bg-black/80 backdrop-blur-sm hidden flex items-center justify-center z-[70] p-4 sm:p-6 opacity-0 transition-opacity duration-200"> + <div class="bg-[#111] w-full max-w-sm rounded-xl shadow-2xl flex flex-col border border-neutral-800 transform scale-95 transition-transform duration-200 p-6"> + <h3 class="text-lg font-bold text-white mb-2 font-heading">Clear Recent Files?</h3> + <p class="text-sm text-neutral-400 mb-6 font-mono">Are you sure you want to delete your recent file history? This action cannot be undone.</p> + <div class="flex justify-end gap-3"> + <button onclick="closeConfirmModal()" class="px-4 py-2 bg-neutral-900 hover:bg-neutral-800 text-neutral-300 text-sm font-medium rounded-lg transition-colors border border-neutral-700 font-mono">Cancel</button> + <button onclick="confirmClearRecentAction()" class="px-4 py-2 bg-red-900/50 hover:bg-red-900 text-red-200 hover:text-white text-sm font-medium rounded-lg transition-colors shadow-sm border border-red-900 font-mono">Delete</button> + </div> + </div> + </div> + + <!-- Toast Notification --> + <div id="toast" class="fixed bottom-4 right-4 bg-neutral-900 text-lime-300 px-4 py-2 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 z-[80] flex items-center gap-2 border border-lime-300/30"> + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg> + <span class="font-mono text-xs uppercase">Link copied to clipboard!</span> + </div> + + <script> + function toggleFolder(header) { + if (header instanceof Event) header = header.currentTarget; + if (!header || typeof header.querySelector !== 'function') return; + + const content = header.nextElementSibling; + const icon = header.querySelector(".chevron"); + const folderIcon = header.querySelector(".folder-icon"); + + content.classList.toggle("hidden"); + icon.classList.toggle("rotated"); + + if (content.classList.contains("hidden")) { + folderIcon.innerHTML = `<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>`; + } else { + folderIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; + } + updateFolderState(); + } + + function updateFolderState() { + const folders = document.querySelectorAll('.folder-container'); + const total = folders.length; + let openCount = 0; + + folders.forEach(f => { + const content = f.children[1]; + if (!content.classList.contains('hidden')) openCount++; + }); + + const btnExpand = document.getElementById('btn-expand'); + const btnCollapse = document.getElementById('btn-collapse'); + + if (total === 0) { + setBtnState(btnExpand, false); + setBtnState(btnCollapse, false); + return; + } + + if (openCount === 0) { + setBtnState(btnExpand, true); + setBtnState(btnCollapse, false); + } else if (openCount === total) { + setBtnState(btnExpand, false); + setBtnState(btnCollapse, true); + } else { + setBtnState(btnExpand, true); + setBtnState(btnCollapse, true); + } + } + + function setBtnState(btn, isActive) { + if (isActive) { + btn.disabled = false; + btn.className = "text-xs font-bold text-lime-300 hover:bg-lime-300/10 px-3 py-1.5 rounded-md transition-all duration-200 cursor-pointer border border-lime-300/30 shadow-sm font-mono"; + } else { + btn.disabled = true; + btn.className = "text-xs font-bold text-neutral-600 px-3 py-1.5 rounded-md cursor-not-allowed bg-neutral-900 border border-transparent font-mono"; + } + } + + function expandAll() { + document.querySelectorAll('.folder-container > div:nth-child(2)').forEach(content => { + content.classList.remove('hidden'); + }); + document.querySelectorAll('.folder-container .chevron').forEach(icon => { + icon.classList.add('rotated'); + }); + document.querySelectorAll('.folder-container .folder-icon').forEach(icon => { + icon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; + }); + updateFolderState(); + } + + function collapseAll() { + document.querySelectorAll('.folder-container > div:nth-child(2)').forEach(content => { + content.classList.add('hidden'); + }); + document.querySelectorAll('.folder-container .chevron').forEach(icon => { + icon.classList.remove('rotated'); + }); + document.querySelectorAll('.folder-container .folder-icon').forEach(icon => { + icon.innerHTML = `<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>`; + }); + updateFolderState(); + } + + const MAX_RECENT_FILES = 6; + let recentFiles = JSON.parse(localStorage.getItem('bsc_recent_files') || '[]'); + + function checkStorageExpiry() { + const now = Date.now(); + const setupTime = localStorage.getItem('bsc_setup_time'); + const threeDays = 3 * 24 * 60 * 60 * 1000; + + if (!setupTime) { + localStorage.setItem('bsc_setup_time', now); + } else { + if (now - parseInt(setupTime) > threeDays) { + localStorage.removeItem('license_accepted'); + localStorage.removeItem('bsc_recent_files'); + localStorage.setItem('bsc_setup_time', now); + recentFiles = []; + } + } + } + checkStorageExpiry(); + + function updateRecentFilesUI() { + const container = document.getElementById('recent-files-container'); + const list = document.getElementById('recent-files-list'); + + if (recentFiles.length === 0) { + container.classList.add('hidden'); + return; + } + + container.classList.remove('hidden'); + list.innerHTML = ''; + + recentFiles.forEach(file => { + const item = document.createElement('div'); + item.className = "flex items-center gap-2 px-3 py-2 bg-[#111] hover:bg-lime-300/10 hover:border-lime-300/30 border border-neutral-800 rounded-lg cursor-pointer transition-all group"; + item.onclick = () => showCode(file.storageId, file.name, file.url); + item.innerHTML = ` + <div class="p-1.5 rounded-md bg-lime-300/10 text-lime-300"> + <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> + </svg> + </div> + <span class="text-xs font-medium text-neutral-400 group-hover:text-white truncate font-mono">${file.name}</span> + `; + list.appendChild(item); + }); + } + + function addToRecent(storageId, name, url) { + recentFiles = recentFiles.filter(f => f.name !== name); + recentFiles.unshift({ storageId, name, url }); + if (recentFiles.length > MAX_RECENT_FILES) recentFiles.pop(); + localStorage.setItem('bsc_recent_files', JSON.stringify(recentFiles)); + updateRecentFilesUI(); + } + + const confirmModal = document.getElementById("confirm-modal"); + + function confirmClearRecent() { + confirmModal.classList.remove("hidden"); + void confirmModal.offsetWidth; + confirmModal.classList.remove("opacity-0"); + confirmModal.querySelector("div").classList.remove("scale-95"); + } + + function closeConfirmModal() { + confirmModal.classList.add("opacity-0"); + confirmModal.querySelector("div").classList.add("scale-95"); + setTimeout(() => { + confirmModal.classList.add("hidden"); + }, 200); + } + + function confirmClearRecentAction() { + recentFiles = []; + localStorage.setItem('bsc_recent_files', JSON.stringify(recentFiles)); + updateRecentFilesUI(); + closeConfirmModal(); + } + + updateRecentFilesUI(); + + const scrollContainer = document.getElementById('file-explorer-scroll'); + const backToTopBtn = document.getElementById('back-to-top'); + + scrollContainer.addEventListener('scroll', () => { + if (scrollContainer.scrollTop > 300) { + backToTopBtn.classList.remove('hidden'); + setTimeout(() => { + backToTopBtn.classList.remove('opacity-0', 'translate-y-4'); + }, 10); + } else { + backToTopBtn.classList.add('opacity-0', 'translate-y-4'); + setTimeout(() => { + if(scrollContainer.scrollTop <= 300) { + backToTopBtn.classList.add('hidden'); + } + }, 300); + } + }); + + function scrollToTop() { + scrollContainer.scrollTo({ + top: 0, + behavior: 'smooth' + }); + } + + function showToast() { + const toast = document.getElementById("toast"); + toast.classList.remove("hidden"); + void toast.offsetWidth; + toast.classList.add("show", "translate-y-0", "opacity-100"); + toast.classList.remove("translate-y-20", "opacity-0"); + + setTimeout(() => { + toast.classList.remove("show", "translate-y-0", "opacity-100"); + toast.classList.add("translate-y-20", "opacity-0"); + setTimeout(() => { + toast.classList.add("hidden"); + }, 300); + }, 3000); + } + + /* --- Code Modal Logic with CodeMirror --- */ + const modal = document.getElementById("code-modal"); + const modalFilename = document.getElementById("modal-filename"); + const modalFileSize = document.getElementById("modal-filesize"); + const modalRawLink = document.getElementById("modal-raw-link"); + const loadingSpinner = document.getElementById("code-loading"); + const newTabBtn = document.getElementById("new-tab-btn"); + const mobileGithubLink = document.getElementById("mobile-github-link"); + + let currentFileUrl = ""; + let editor = null; + + function detectMode(filename) { + if (filename.endsWith('.c')) return 'text/x-csrc'; + if (filename.endsWith('.cpp') || filename.endsWith('.h')) return 'text/x-c++src'; + if (filename.endsWith('.py')) return 'text/x-python'; + if (filename.endsWith('.js')) return 'text/javascript'; + if (filename.endsWith('.html') || filename.endsWith('.xml')) return 'text/html'; + return 'text/plain'; + } + + function showCode(storageId, filename, rawUrl) { + currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename); + modal.classList.remove("hidden"); + void modal.offsetWidth; + modal.classList.remove("opacity-0"); + modal.querySelector("div").classList.remove("scale-95"); + + modalFilename.textContent = filename; + modalRawLink.href = rawUrl; + if(mobileGithubLink) mobileGithubLink.href = rawUrl; + + addToRecent(storageId, filename, rawUrl); + + const storedContent = document.getElementById(storageId); + let code = ""; + + if (storedContent) { + code = storedContent.textContent; + + const bytes = new Blob([code]).size; + const sizeStr = bytes > 1024 ? (bytes/1024).toFixed(2) + " KB" : bytes + " B"; + modalFileSize.textContent = sizeStr; + + newTabBtn.onclick = () => { + const newWindow = window.open(); + newWindow.document.write('<html><head><title>' + filename + '</title>'); + newWindow.document.write('<style>body{font-family: monospace; white-space: pre-wrap; padding: 20px; background: #0d1117; color: #e6edf3;} </style>'); + newWindow.document.write('</head><body><pre>' + code.replace(/</g, "&lt;").replace(/>/g, "&gt;") + '</pre></body></html>'); + newWindow.document.close(); + }; + + } else { + code = "// Error: Content not found"; + modalFileSize.textContent = ""; + } + + const mode = detectMode(filename); + + if (!editor) { + editor = CodeMirror(document.getElementById("modal-code-container"), { + value: code, + mode: mode, + theme: "dracula", + lineNumbers: true, + readOnly: true, + styleActiveLine: true + }); + } else { + editor.setValue(code); + editor.setOption("mode", mode); + } + + setTimeout(() => editor.refresh(), 10); + + const newUrl = new URL(window.location); + newUrl.searchParams.set('file', filename); + window.history.pushState({ path: newUrl.href }, '', newUrl.href); + } + + function hideCode() { + // Close mobile menu if open + const dropdown = document.getElementById('mobile-menu-dropdown'); + if (!dropdown.classList.contains('hidden')) { + dropdown.classList.add('hidden'); + } + + modal.classList.add("opacity-0"); + modal.querySelector("div").classList.add("scale-95"); + + setTimeout(() => { + modal.classList.add("hidden"); + if(editor) editor.setValue(""); + }, 200); + + const newUrl = new URL(window.location); + newUrl.searchParams.delete('file'); + window.history.pushState({ path: newUrl.href }, '', newUrl.href); + } + + const downloadBtn = document.getElementById("download-btn"); + downloadBtn.addEventListener("click", () => { + const filename = modalFilename.textContent; + const content = editor ? editor.getValue() : ""; + + const element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content)); + element.setAttribute('download', filename); + + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); + }); + + function printCode() { + const content = editor ? editor.getValue() : ""; + const filename = document.getElementById('modal-filename').textContent; + + const printWindow = window.open('', '', 'height=600,width=800'); + printWindow.document.write('<html><head><title>' + filename + '</title>'); + printWindow.document.write('<style>body{font-family: monospace; white-space: pre-wrap; padding: 20px;} </style>'); + printWindow.document.write('</head><body>'); + const safeContent = content.replace(/</g, "&lt;").replace(/>/g, "&gt;"); + printWindow.document.write('<pre>' + safeContent + '</pre>'); + printWindow.document.write('</body></html>'); + printWindow.document.close(); + printWindow.focus(); + printWindow.print(); + } + + /* --- NEW COMPILER FEATURE --- */ + function openInCompiler() { + const codeText = editor ? editor.getValue() : ""; + if (!codeText) return; + + // Compress using LZ-String + const compressed = LZString.compressToEncodedURIComponent(codeText); + const url = `https://compiler.amit.is-a.dev/c?code=${compressed}`; + + window.open(url, '_blank'); + } + + /* --- NEW MOBILE MENU --- */ + function toggleMobileMenu(e) { + e.stopPropagation(); + const dropdown = document.getElementById('mobile-menu-dropdown'); + dropdown.classList.toggle('hidden'); + } + + // Close mobile menu when clicking outside + document.addEventListener('click', function(e) { + const dropdown = document.getElementById('mobile-menu-dropdown'); + const btn = document.getElementById('mobile-menu-btn'); + + if (!dropdown.classList.contains('hidden') && !btn.contains(e.target) && !dropdown.contains(e.target)) { + dropdown.classList.add('hidden'); + } + }); + + /* --- License Modal Logic --- */ + const licenseModal = document.getElementById("license-modal"); + const licenseFooter = document.getElementById("license-footer"); + const licenseCloseBtn = document.getElementById("license-close-btn"); + const appContent = document.getElementById("app-content"); + + function openLicenseModal(forced) { + licenseModal.classList.remove("hidden"); + void licenseModal.offsetWidth; + licenseModal.classList.remove("opacity-0"); + licenseModal.querySelector("div").classList.remove("scale-95"); + + licenseFooter.innerHTML = ""; + + if (forced) { + licenseCloseBtn.classList.add("hidden"); + + const btnDecline = document.createElement("button"); + btnDecline.className = "px-4 py-2 bg-neutral-900 hover:bg-red-900/20 text-neutral-400 hover:text-red-400 text-sm font-medium rounded-lg transition-colors border border-neutral-700 font-mono"; + btnDecline.innerText = "Decline"; + btnDecline.onclick = declineLicense; + + const btnAccept = document.createElement("button"); + btnAccept.className = "px-4 py-2 bg-lime-300 hover:bg-lime-400 text-black text-sm font-bold rounded-lg transition-colors shadow-sm font-mono"; + btnAccept.innerText = "Accept"; + btnAccept.onclick = acceptLicense; + + licenseFooter.appendChild(btnDecline); + licenseFooter.appendChild(btnAccept); + } else { + licenseCloseBtn.classList.remove("hidden"); + + const btnUnderstand = document.createElement("button"); + btnUnderstand.className = "px-4 py-2 bg-neutral-900 hover:bg-neutral-800 text-white text-sm font-medium rounded-lg transition-colors shadow-sm border border-neutral-700 font-mono"; + btnUnderstand.innerText = "I Understand"; + btnUnderstand.onclick = hideLicense; + + licenseFooter.appendChild(btnUnderstand); + } + } + + function hideLicense() { + licenseModal.classList.add("opacity-0"); + licenseModal.querySelector("div").classList.add("scale-95"); + setTimeout(() => { + licenseModal.classList.add("hidden"); + }, 200); + } + + function acceptLicense() { + localStorage.setItem("license_accepted", "true"); + hideLicense(); + appContent.style.display = "flex"; + } + + function declineLicense() { + document.documentElement.innerHTML = ""; + if (window.history.length > 1) { + window.history.back(); + } else { + window.close(); + } + } + + function checkLicense() { + const accepted = localStorage.getItem("license_accepted"); + if (accepted === "true") { + appContent.style.display = "flex"; + } else { + openLicenseModal(true); + } + } + + document.addEventListener("keydown", (e) => { + if (e.key === "Escape" && !licenseModal.classList.contains("hidden")) { + if (!licenseCloseBtn.classList.contains("hidden")) { + hideLicense(); + } + } + }); + + licenseModal.addEventListener("click", (e) => { + if (e.target === licenseModal) { + if (!licenseCloseBtn.classList.contains("hidden")) { + hideLicense(); + } + } + }); + + checkLicense(); + + /* --- Search Logic --- */ + let searchIndex = []; + + function buildSearchIndex() { + searchIndex = []; + const fileElements = document.querySelectorAll(".file-item"); + fileElements.forEach((el) => { + const name = el.querySelector("span").textContent.toLowerCase().trim(); + const parentContent = el.closest(".pl-4"); + + const codeDiv = el.querySelector("div[id^='code-']"); + const code = codeDiv ? codeDiv.textContent.toLowerCase() : ""; + + const storageId = codeDiv ? codeDiv.id : ""; + + searchIndex.push({ name, code, element: el, parent: parentContent, storageId }); + }); + } + + const searchInput = document.getElementById("search-input"); + + function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + } + + searchInput.addEventListener("input", (e) => { + const query = e.target.value.toLowerCase(); + + document.querySelectorAll('.search-snippet').forEach(el => el.remove()); + document.querySelectorAll('.file-item').forEach(el => { + el.classList.remove('flex-wrap', 'pb-2'); + el.classList.remove('nav-selected'); + }); + + selectedFileIndex = -1; + + if (searchIndex.length === 0) buildSearchIndex(); + + if (!query) { + document.querySelectorAll('.file-item, .folder-container').forEach(el => el.classList.remove('hidden')); + updateFolderState(); + return; + } + + document.querySelectorAll('.file-item').forEach(el => el.classList.add('hidden')); + document.querySelectorAll('.folder-container').forEach(el => el.classList.add('hidden')); + + searchIndex.forEach(item => { + const nameMatch = item.name.includes(query); + const codeMatch = item.code.includes(query); + + if (nameMatch || codeMatch) { + item.element.classList.remove('hidden'); + + let parent = item.element.parentElement; + while(parent && parent.id !== "file-list-container") { + parent.classList.remove('hidden'); + if (parent.previousElementSibling) { + const folderContainer = parent.parentElement; + if(folderContainer.classList.contains('folder-container')) { + folderContainer.classList.remove('hidden'); + } + + if(parent.classList.contains('hidden')) { + const chevron = parent.previousElementSibling.querySelector('.chevron'); + if(chevron && !chevron.classList.contains('rotated')) { + chevron.classList.add('rotated'); + } + const fIcon = parent.previousElementSibling.querySelector('.folder-icon'); + if(fIcon) fIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; + } + } + parent = parent.parentElement; + } + + if (codeMatch) { + const originalCodeDiv = item.element.querySelector("div[id^='code-']"); + if (originalCodeDiv) { + const originalCode = originalCodeDiv.textContent; + const matchIndex = item.code.indexOf(query); + + if (matchIndex !== -1) { + const codePreMatch = item.code.substring(0, matchIndex); + const lineCount = (codePreMatch.match(/\n/g) || []).length; + + const allLines = originalCode.split('\n'); + const startLine = Math.max(0, lineCount - 2); + const endLine = Math.min(allLines.length, lineCount + 3); + + const snippetLines = allLines.slice(startLine, endLine); + + const snippetDiv = document.createElement('div'); + snippetDiv.className = 'search-snippet w-full mt-2 ml-4 sm:ml-7 p-2 bg-[#111] border-l-4 border-lime-300 rounded-r text-xs font-mono text-neutral-400 overflow-x-auto shadow-sm cursor-pointer hover:bg-neutral-900 transition-colors'; + + snippetDiv.onclick = (evt) => { + evt.stopPropagation(); + const rawUrl = item.element.querySelector(".flex-1").getAttribute('onclick').match(/'([^']*)'\)$/)[1]; + showCode(item.storageId, item.element.querySelector("span").textContent, rawUrl); + }; + + let htmlContent = ''; + const safeQuery = escapeRegExp(query); + const highlightRegex = new RegExp(`(${safeQuery})`, 'gi'); + + snippetLines.forEach((line, idx) => { + const currentLineNum = startLine + idx + 1; + let safeLine = line.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;"); + safeLine = safeLine.replace(highlightRegex, '<mark class="bg-lime-300 text-black font-bold rounded-sm px-0.5">$1</mark>'); + + const isMatchLine = (currentLineNum - 1) === lineCount; + const lineClass = isMatchLine ? 'bg-lime-300/10 font-semibold' : ''; + + htmlContent += `<div class="whitespace-pre ${lineClass}"><span class="inline-block w-8 text-right mr-3 text-neutral-600 select-none border-r border-neutral-700 pr-1">${currentLineNum}</span>${safeLine}</div>`; + }); + + snippetDiv.innerHTML = htmlContent; + item.element.classList.add('flex-wrap', 'pb-2'); + item.element.appendChild(snippetDiv); + } + } + } + } + }); + }); + + let selectedFileIndex = -1; + + function handleKeyboardNav(e) { + if (!modal.classList.contains("hidden")) return; + + const visibleFiles = Array.from(document.querySelectorAll('.file-item:not(.hidden)')); + if (visibleFiles.length === 0) return; + + if (e.key === 'ArrowDown') { + e.preventDefault(); + selectedFileIndex = (selectedFileIndex + 1) % visibleFiles.length; + updateSelection(visibleFiles); + } else if (e.key === 'ArrowUp') { + e.preventDefault(); + selectedFileIndex = (selectedFileIndex - 1 + visibleFiles.length) % visibleFiles.length; + updateSelection(visibleFiles); + } else if (e.key === 'Enter' && selectedFileIndex !== -1) { + e.preventDefault(); + const clickTarget = visibleFiles[selectedFileIndex].querySelector('.flex-1'); + if (clickTarget) clickTarget.click(); + } + } + + function updateSelection(files) { + files.forEach(el => el.classList.remove('nav-selected')); + if (selectedFileIndex >= 0 && selectedFileIndex < files.length) { + const selectedEl = files[selectedFileIndex]; + selectedEl.classList.add('nav-selected'); + selectedEl.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); + } + } + + function animateSuccess(btn, defaultIcon, successIcon) { + defaultIcon.classList.add("hidden", "scale-0"); + successIcon.classList.remove("hidden", "scale-0"); + + setTimeout(() => { + successIcon.classList.add("hidden", "scale-0"); + defaultIcon.classList.remove("hidden", "scale-0"); + }, 2000); + } + + document.addEventListener("DOMContentLoaded", () => { + updateFolderState(); + + const params = new URLSearchParams(window.location.search); + const sharedFile = params.get('file'); + if (sharedFile) { + const fileElements = document.querySelectorAll(".file-item"); + for (let el of fileElements) { + const nameSpan = el.querySelector("span"); + if (nameSpan && nameSpan.textContent.trim() === sharedFile) { + const clickable = el.querySelector(".flex-1"); + + let parentContent = el.closest('.pl-4'); + while (parentContent) { + parentContent.classList.remove('hidden'); + const folderHeader = parentContent.previousElementSibling; + if (folderHeader) { + const chevron = folderHeader.querySelector('.chevron'); + const folderIcon = folderHeader.querySelector('.folder-icon'); + if (chevron) chevron.classList.add('rotated'); + if (folderIcon) folderIcon.innerHTML = `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"></path>`; + } + parentContent = parentContent.parentElement.closest('.pl-4'); + } + + if (clickable) { + clickable.click(); + setTimeout(() => { + el.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }, 300); + } + break; + } + } + } + + const shareBtn = document.getElementById("share-btn"); + const shareIconDefault = document.getElementById("share-icon-default"); + const shareIconSuccess = document.getElementById("share-icon-success"); + + shareBtn.addEventListener("click", async () => { + if (!currentFileUrl) return; + + const shareData = { + title: modalFilename.textContent, + text: `Check out this code,\nFile: ${modalFilename.textContent}\nLink: `, + url: currentFileUrl, + }; + + if (navigator.share) { + try { + await navigator.share(shareData); + } catch (err) { + if (err.name !== "AbortError") { + console.error("Share failed:", err.message); + } + } + } else { + navigator.clipboard.writeText(currentFileUrl).then(() => { + animateSuccess(shareBtn, shareIconDefault, shareIconSuccess); + showToast(); + }); + } + }); + + const copyCodeBtn = document.getElementById("copy-code-btn"); + const copyIconDefault = document.getElementById("copy-icon-default"); + const copyIconSuccess = document.getElementById("copy-icon-success"); + + copyCodeBtn.addEventListener("click", () => { + const codeText = editor ? editor.getValue() : ""; + navigator.clipboard.writeText(codeText).then(() => { + animateSuccess(copyCodeBtn, copyIconDefault, copyIconSuccess); + }).catch(err => { + console.error('Failed to copy code: ', err); + }); + }); + + document.addEventListener("keydown", (e) => { + const searchInput = document.getElementById("search-input"); + if (e.key === "Escape" && !modal.classList.contains("hidden")) { + hideCode(); + return; + } + if ( + e.key === "/" && + modal.classList.contains("hidden") && + !/^(INPUT|TEXTAREA|SELECT)$/i.test(document.activeElement.tagName) + ) { + e.preventDefault(); + searchInput.focus(); + } + }); + }); + </script> + </body> </html> \ 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