commit e026aa4255a5421f8b53c672c7825da8cdc4014d
parent d82b007e4d7eeaa9588708232948a7c42706170d
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Fri, 12 Dec 2025 11:10:43 +0530
[2025-12-12] .\docs\..\ : Updated code showing logic.
Diffstat:
| M | docs/generate_index.py | | | 56 | +++++++++++++++++++++++++------------------------------- |
| M | docs/index.html | | | 17705 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- |
| M | docs/template.html | | | 253 | +++++++++++++++++++++++++++++++++---------------------------------------------- |
3 files changed, 17227 insertions(+), 787 deletions(-)
diff --git a/docs/generate_index.py b/docs/generate_index.py
@@ -17,16 +17,6 @@ EXCLUDED_FILES = [
]
# --- End Configuration ---
-def get_language_class(filename):
- """Gets the highlight.js language class from the file extension."""
- if filename.endswith('.c'): return 'c'
- if filename.endswith('.py'): return 'python'
- if filename.endswith('.html'): return 'xml'
- if filename.endswith('.js'): return 'javascript'
- if filename.endswith('.css'): return 'css'
- if filename.endswith('.md'): return 'markdown'
- return 'plaintext'
-
def process_directory(current_path, relative_base=""):
"""
Recursively walks the directory and returns HTML string for the file tree.
@@ -53,7 +43,7 @@ def process_directory(current_path, relative_base=""):
if item not in EXCLUDED_FILES:
files.append(item)
- # Sort items (folders first, then files, alphabetically)
+ # Sort items
dirs.sort()
files.sort()
@@ -62,15 +52,11 @@ def process_directory(current_path, relative_base=""):
sub_path = os.path.join(current_path, d)
rel_path = os.path.join(relative_base, d).replace("\\", "/")
- # Recurse to get content
content_html = process_directory(sub_path, rel_path)
- # Only show folder if it has content (optional, but cleaner)
if not content_html.strip():
continue
- # Folder HTML Structure
- # Note: onclick="toggleFolder(this)" passes the header element itself
html_output += f"""
<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)">
@@ -90,18 +76,29 @@ def process_directory(current_path, relative_base=""):
# --- Generate HTML for Files ---
for f in files:
- # File URL for raw content fetching
- raw_url = f"https://raw.githubusercontent.com/notamitgamer/bsc/main/{relative_base}/{f}".replace("//", "/")
- # GitHub URL for viewing
- github_url = f"{REPO_URL}/blob/main/{relative_base}/{f}".replace("//", "/")
+ full_file_path = os.path.join(current_path, f)
+ url_path = f"{relative_base}/{f}" if relative_base else f
+ github_url = f"{REPO_URL}/blob/main/{url_path}"
- file_ext = os.path.splitext(f)[1]
+ # 1. READ CONTENT
+ try:
+ with open(full_file_path, 'r', encoding='utf-8', errors='ignore') as code_file:
+ raw_code = code_file.read()
+ except Exception as e:
+ raw_code = f"Error reading file content: {e}"
+
+ # 2. ESCAPE CONTENT (Safe for HTML)
+ escaped_code = html.escape(raw_code)
- # File Item HTML
- # Using onclick to trigger modal
+ # 3. GENERATE UNIQUE ID
+ # Create a safe ID string from the path (e.g., "code-assignment-primary-file-c")
+ safe_id = "code-" + url_path.replace("/", "-").replace(".", "-").replace(" ", "-")
+
+ # 4. GENERATE HTML
+ # We create a hidden DIV to store the code.
html_output += f"""
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('{html.escape(f)}', '{html.escape(f)}', '{raw_url}')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('{safe_id}', '{html.escape(f)}', '{github_url}')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
@@ -112,6 +109,8 @@ def process_directory(current_path, relative_base=""):
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="{safe_id}" style="display:none;">{escaped_code}</div>
</div>
"""
@@ -119,13 +118,11 @@ def process_directory(current_path, relative_base=""):
def main():
root_dir = os.getcwd()
-
- # Updated paths: Read template from and write index to the 'docs' folder
docs_dir = os.path.join(root_dir, 'docs')
template_path = os.path.join(docs_dir, 'template.html')
output_path = os.path.join(docs_dir, 'index.html')
- print("Generating index.html...")
+ print("Generating index.html with embedded code...")
try:
with open(template_path, 'r', encoding='utf-8') as f:
@@ -140,9 +137,8 @@ def main():
# Inject into template
final_html = template.replace('<!--FILE_LIST_PLACEHOLDER-->', file_list_html)
- # 1. Write to local index.html in docs folder
+ # 1. Write to local index.html
try:
- # Ensure docs folder exists (just in case)
os.makedirs(docs_dir, exist_ok=True)
with open(output_path, 'w', encoding='utf-8') as f:
f.write(final_html)
@@ -150,12 +146,10 @@ def main():
except Exception as e:
print(f"Error writing index.html: {e}")
- # 2. Write to secondary path (Desktop) if accessible
+ # 2. Write to secondary path (Desktop)
second_output_path = r"C:\Users\PC\Desktop\aranag.site\bsc.html"
try:
- # Create directory if it doesn't exist (safety check)
os.makedirs(os.path.dirname(second_output_path), exist_ok=True)
-
with open(second_output_path, 'w', encoding='utf-8') as f:
f.write(final_html)
print(f"Also updated bsc.html successfully at '{second_output_path}'.")
diff --git a/docs/index.html b/docs/index.html
@@ -3,6 +3,8 @@
<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>
<script src="https://cdn.tailwindcss.com"></script>
<link
@@ -125,7 +127,7 @@
</p>
</div>
</div>
- <!-- Mobile: Github Icon (Visible only on small screens to save space in row 2) -->
+ <!-- Mobile: Github Icon -->
<a href="https://github.com/notamitgamer/bsc" target="_blank" class="sm:hidden text-slate-600 hover:text-slate-900">
<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>
@@ -172,16 +174,8 @@
class="hidden sm:flex bg-slate-900 hover:bg-slate-800 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all shadow-sm items-center gap-2"
>
<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 class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
+ <path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path>
</svg>
</a>
</div>
@@ -207,213 +201,1539 @@
<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('assignment-p-01.c', 'assignment-p-01.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-01.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-01-c', 'assignment-p-01.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-01-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int isPrime(int);
+
+int main()
+{
+ int n;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+
+ if (isPrime(n))
+ {
+ printf("\nInput %d is a Prime Number.", n);
+ }
+ else
+ {
+ printf("\nInput %d is not a Prime Number.", n);
+ }
+
+ return 0;
+}
+
+int isPrime(int n)
+{
+ if (n <= 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 <= 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('assignment-p-02.c', 'assignment-p-02.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-02.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-02-c', 'assignment-p-02.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-02-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int isArmstrong(int);
+int count(int);
+
+int main()
+{
+ int n;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+
+ if (isArmstrong(n))
+ {
+ printf("\nInput %d is a Armstrong Number.", n);
+ }
+ else
+ {
+ printf("\nInput %d is Not a Armstrong Number.", n);
+ }
+
+ return 0;
+}
+
+int count(int n)
+{
+ int count = 0;
+ while (n > 0)
+ {
+ count++;
+ n = n / 10;
+ }
+ return count;
+}
+
+int isArmstrong(int n)
+{
+ if (n < 0)
+ return 0;
+ if (n == 0)
+ return 1;
+
+ int power = count(n);
+ int temp = n;
+ int checker = 0;
+
+ while (temp > 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('assignment-p-03.c', 'assignment-p-03.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-03.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-03-c', 'assignment-p-03.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-03-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int isPerfect(int);
+
+int main()
+{
+ int n;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+ if (isPerfect(n))
+ {
+ printf("\nInput %d is a Perfect Number.", n);
+ }
+ else
+ {
+ printf("\nInput %d is not a Perfect Number.", n);
+ }
+ return 0;
+}
+
+int isPerfect(int n)
+{
+ if (n <= 1)
+ return 0;
+ int temp = 1;
+ int i;
+ for (i = 2; i <= 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('assignment-p-04.c', 'assignment-p-04.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-04.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-04-c', 'assignment-p-04.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-04-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int month, year, days;
+ printf("Enter the month (1 to 12) and year: ");
+ scanf("%d %d", &month, &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) && (year % 100 != 0)))
+ {
+ days = 29;
+ }
+ else
+ {
+ days = 28;
+ }
+ break;
+ default:
+ printf("\nYou entered something wrong.");
+ return 0;
+ }
+
+ printf("\nNumber of days: %d", 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('assignment-p-05.c', 'assignment-p-05.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-05.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-05-c', 'assignment-p-05.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-05-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void inputArray(int[], int);
+void reverseArray(int[], int);
+
+int main()
+{
+ int size;
+ printf("How many element do you want to add: ");
+ scanf("%d", &size);
+ int arr[size];
+ inputArray(arr, size);
+ reverseArray(arr, size);
+ return 0;
+}
+
+void inputArray(int arr[], int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ {
+ printf("Enter element %d: ", i + 1);
+ scanf("%d", &arr[i]);
+ }
+}
+
+void reverseArray(int arr[], int size)
+{
+ int i, j, temp;
+ printf("\nBefore Reverse: \n");
+ for (i = 0; i < size; i++)
+ {
+ printf("Position: %d, Value: %d\n", i, arr[i]);
+ }
+ for (i = 0, j = size - 1; i < j; i++, j--)
+ {
+ temp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = temp;
+ }
+ printf("\nAfter Reverse: \n");
+ for (i = 0; i < size; i++)
+ {
+ printf("Position: %d, Value: %d\n", 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('assignment-p-06.c', 'assignment-p-06.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-06.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-06-c', 'assignment-p-06.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-06-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void inputArray(int[], int);
+int findLargest(int[], int);
+
+int main()
+{
+ int size;
+ printf("How many element do you want to enter: ");
+ scanf("%d", &size);
+ int arr[size];
+ inputArray(arr, size);
+ printf("\nLargest Element is: %d", findLargest(arr, size));
+ return 0;
+}
+
+void inputArray(int arr[], int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ {
+ printf("Enter element %d: ", i + 1);
+ scanf("%d", &arr[i]);
+ }
+}
+
+int findLargest(int arr[], int size)
+{
+ int largest = arr[0], i;
+ for (i = 1; i < size; i++)
+ {
+ if (largest < 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('assignment-p-07.c', 'assignment-p-07.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-07.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-07-c', 'assignment-p-07.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-07-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int inputArray(int[], int);
+// void sortArray(int[], int);
+int binarySearch(int[], int, int);
+
+int main()
+{
+ int size;
+ printf("How many element do you want to enter: ");
+ scanf("%d", &size);
+ int arr[size];
+ int target = inputArray(arr, size);
+ // sortArray(arr, size);
+ int index = binarySearch(arr, size, target);
+ if (index != -1)
+ {
+ printf("\nElement %d is found at index %d.", target, index);
+ }
+ else
+ {
+ printf("\nElement %d is not found.", target);
+ }
+ return 0;
+}
+
+int inputArray(int arr[], int size)
+{
+ int i, target;
+ for (i = 0; i < size; i++)
+ {
+ printf("Enter element for position %d: ", i);
+ scanf("%d", &arr[i]);
+ }
+ printf("\nEnter the target element: ");
+ scanf("%d", &target);
+ return target;
+}
+
+/* void sortArray(int arr[], int size)
+{
+ // using Bubble Sort...
+
+ int tempArr[size], i, j, temp;
+ printf("\nBefore Sorting:\n[");
+ for (i = 0; i < size; i++)
+ {
+ printf("%d", arr[i]);
+ if (i != size - 1)
+ {
+ printf(", ");
+ }
+ }
+ printf("]\n");
+ for (i = 0; i < size - 1; i++)
+ {
+ for (j = 0; j < size - i - 1; j++)
+ {
+ if (arr[j] > arr[j + 1])
+ {
+ temp = arr[j];
+ arr[j] = arr[j + 1];
+ arr[j + 1] = temp;
+ }
+ }
+ }
+ printf("\nAfter Sorting:\n[");
+ for (i = 0; i < size; i++)
+ {
+ printf("%d", arr[i]);
+ if (i != size - 1)
+ {
+ printf(", ");
+ }
+ }
+ printf("]\n");
+}
+*/
+
+int binarySearch(int arr[], int size, int target)
+{
+ int low = 0;
+ int high = size - 1;
+ int mid;
+ while (low <= high)
+ {
+ mid = low + ((high - low) / 2);
+ if (arr[mid] == target)
+ {
+ return mid;
+ }
+ else if (arr[mid] > target)
+ {
+ high = mid - 1;
+ }
+ else if (arr[mid] < 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('assignment-p-08.c', 'assignment-p-08.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-08.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-08-c', 'assignment-p-08.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-08-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int countSetBits(int);
+
+int main()
+{
+ int num, result;
+ printf("Enter the number: ");
+ scanf("%d", &num);
+ if (result = countSetBits(num))
+ {
+ printf("\nNumber of set bits in %d: %d", num, result);
+ }
+ else
+ {
+ printf("\nThere is no set bits in %d", num);
+ }
+ return 0;
+}
+
+int countSetBits(int num)
+{
+ int count = 0;
+ if (num < 0)
+ {
+ printf("\nOnly positive numbers are allowed to maintain consistency. \nUsing absolute value %d", -num);
+ num = -num;
+ }
+ while (num > 0)
+ {
+ if (num & 1)
+ {
+ count++;
+ }
+ num >>= 1;
+ /*
+ Another method to do the above bitwise calculation...
+ if(num % 2 == 1) {
+ count++;
+ }
+ num /= 2;
+ */
+ }
+ 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('assignment-p-09.c', 'assignment-p-09.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-09.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-09-c', 'assignment-p-09.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-09-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int setBit(int, int);
+
+int main()
+{
+ int num, position;
+ printf("Enter the number: ");
+ scanf("%d", &num);
+ printf("Enter the postion where you want to set the bit (0-indexed): ");
+ scanf("%d", &position);
+ printf("\nModified number= %d", setBit(num, position));
+ return 0;
+}
+
+int setBit(int num, int position)
+{
+ int mask = 1 << 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('assignment-p-10.c', 'assignment-p-10.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-10.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-10-c', 'assignment-p-10.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-10-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+struct Rectangle
+{
+ float length;
+ float width;
+};
+
+float calculateArea(struct Rectangle);
+
+int main()
+{
+ struct Rectangle rectangle;
+ printf("Enter the length of the Rectangle: ");
+ scanf("%f", &rectangle.length);
+ printf("Enter the width of the Rectangle: ");
+ scanf("%f", &rectangle.width);
+ printf("\nArea of the Rectangle = %g", calculateArea(rectangle));
+}
+
+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('assignment-p-11.c', 'assignment-p-11.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-11.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-11-c', 'assignment-p-11.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-11-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <string.h>
+
+struct Student
+{
+ int rollNumber;
+ char name[50];
+ int marks;
+};
+
+void inputStudent(struct Student *, int);
+void displayStudent(struct Student);
+
+int main()
+{
+ struct Student studentDetails[10];
+ int i, inputCount;
+ printf("How many student details you want to add (Max: 10): ");
+ if (scanf("%d", &inputCount) != 1 || inputCount < 1 || inputCount > 10)
+ {
+ printf("\nInvalid Input.");
+ return 1;
+ }
+ for (i = 0; i < inputCount; i++)
+ {
+ inputStudent(&studentDetails[i], i + 1);
+ }
+ printf("\n=== Student Details ===\n");
+ for (i = 0; i < inputCount; i++)
+ {
+ displayStudent(studentDetails[i]);
+ }
+ return 0;
+}
+
+void inputStudent(struct Student *std, int stdNum)
+{
+ printf("\n- Enter details of Student %d -", stdNum);
+ printf("\nEnter the Roll Number: ");
+ scanf("%d", &std->rollNumber);
+ while (getchar() != '\n')
+ ;
+ printf("Enter the Name: ");
+ fgets(std->name, sizeof(std->name), stdin);
+ printf("Enter the Marks: ");
+ scanf("%d", &std->marks);
+}
+
+void displayStudent(struct Student std)
+{
+ printf("\n\nRoll Number: %d", std.rollNumber);
+ printf("\nName : %s", std.name);
+ printf("Marks : %d", 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('assignment-p-12.c', 'assignment-p-12.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-12.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-12-c', 'assignment-p-12.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-12-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a C program that takes multiple integers as command-line arguments and finds the
+maximum and minimum value among them. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ int current_val, max_val, min_val, i;
+ char *endptr;
+ long first_arg_val;
+ if (argc < 2)
+ {
+ printf("Usage: %s <integer1> <integer2> ...\n", argv[0]);
+ return 1;
+ }
+ first_arg_val = strtol(argv[1], &endptr, 10);
+ if (*endptr != '\0' || argv[1] == endptr)
+ {
+ printf("Error: Argument '%s' is not a valid integer.\n", argv[1]);
+ return 1;
+ }
+ max_val = (int)first_arg_val;
+ min_val = (int)first_arg_val;
+ for (i = 2; i < argc; i++)
+ {
+ long val = strtol(argv[i], &endptr, 10);
+ if (*endptr != '\0' || argv[i] == endptr)
+ {
+ printf("Error: Argument '%s' is not a valid integer.\n", argv[i]);
+ return 1;
+ }
+ current_val = (int)val;
+ if (current_val > max_val)
+ {
+ max_val = current_val;
+ }
+ if (current_val < min_val)
+ {
+ min_val = current_val;
+ }
+ }
+ printf("The maximum value is: %d\n", max_val);
+ printf("The minimum value is: %d\n", 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('assignment-p-13.c', 'assignment-p-13.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-13.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-13-c', 'assignment-p-13.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-13-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+
+int isPalindrome(char[]);
+
+int main(int argc, char *argv[])
+{
+ if (argc != 2)
+ {
+ printf("\nUsage: %s <string>\n", argv[0]);
+ return 1;
+ }
+ if (isPalindrome(argv[1]))
+ {
+ printf("\nThe entered string \"%s\" is a Palindrome.\n", argv[1]);
+ }
+ else
+ {
+ printf("\nThe entered string \"%s\" is not Palindrome.\n", argv[1]);
+ }
+ return 0;
+}
+
+int isPalindrome(char str[])
+{
+ char *start = str;
+ char *end = str;
+ if (*end != '\0')
+ {
+ while (*(end + 1) != '\0')
+ {
+ 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 < 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('assignment-p-14.c', 'assignment-p-14.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-14.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-14-c', 'assignment-p-14.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-14-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a C program that opens its own source code file, reads its contents, and then prints
+the contents to the console. */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+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("\nMemory allocation failed.\n");
+ return 1;
+ }
+
+ dot = strrchr(FILENAME, '.');
+
+ if (dot != NULL)
+ {
+ len_upto_dot = dot - FILENAME;
+ FILENAME[len_upto_dot] = '\0';
+ }
+
+ strcat(FILENAME, ".c");
+
+ code = fopen(FILENAME, "r");
+
+ if (code == NULL)
+ {
+ printf("\nCould not open the source file: %s", FILENAME);
+ printf("\nPlease ensure the source file is in the same directory as the executable.\n");
+ free(FILENAME);
+ return 1;
+ }
+
+ printf("\nReading file: %s", FILENAME);
+ printf("\n========== %s ==========\n\n", FILENAME);
+
+ while ((character = fgetc(code)) != EOF)
+ {
+ putchar(character);
+ }
+
+ printf("\n\n========== End of %s ==========\n", 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('assignment-p-15.c', 'assignment-p-15.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-primary/assignment-p-15.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-primary-assignment-p-15-c', 'assignment-p-15.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-primary-assignment-p-15-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a C program that reads a sequence of integers from a file named 'input.txt'. This
+program should segregate the odd numbers from the even numbers and store the odd
+numbers in a new file named 'ODDFile.txt' while storing the even numbers in another file
+named 'EVENFile.txt' */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define FILENAME "input.txt"
+#define ODDFILE "ODDFile.txt"
+#define EVENFILE "EVENFile.txt"
+
+int main()
+{
+ FILE *numbers = NULL;
+ FILE *oddfile = NULL;
+ FILE *evenfile = NULL;
+ int num;
+ numbers = fopen(FILENAME, "r");
+ if (numbers == NULL)
+ {
+ printf("\nCould not open the file: %s", FILENAME);
+ free(numbers);
+ return 1;
+ }
+ oddfile = fopen(ODDFILE, "w");
+ if (oddfile == NULL)
+ {
+ printf("\nCould not open the file: %s", ODDFILE);
+ free(oddfile);
+ return 1;
+ }
+ evenfile = fopen(EVENFILE, "w");
+ if (evenfile == NULL)
+ {
+ printf("\nCould not open the file: %s", EVENFILE);
+ free(evenfile);
+ return 1;
+ }
+ while (fscanf(numbers, "%d", &num) == 1)
+ {
+ if (num % 2 == 0)
+ {
+ fprintf(evenfile, "%d ", num);
+ }
+ else
+ {
+ fprintf(oddfile, "%d ", num);
+ }
+ }
+ printf("\nSuccessfully processed numbers from %s.\n", FILENAME);
+ printf("Odd numbers written to %s.\n", ODDFILE);
+ printf("Even numbers written to %s.\n", EVENFILE);
+
+ fclose(numbers);
+ fclose(oddfile);
+ fclose(evenfile);
+
+ return 0;
+}</div>
</div>
</div>
@@ -432,115 +1752,731 @@
<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('assignment-s-01.c', 'assignment-s-01.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-01.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-01-c', 'assignment-s-01.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-01-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to compute the sum and product of digits of an integer using user
+defined functions. */
+
+#include <stdio.h>
+
+int sum_of_digits(int);
+int product_of_digits(int);
+
+int main()
+{
+ int num;
+ printf("Enter the number: ");
+ scanf("%d", &num);
+ printf("\nSum of digits of %d = %d", num, sum_of_digits(num));
+ printf("\nProduct of digits of %d = %d", num, product_of_digits(num));
+ return 0;
+}
+
+int sum_of_digits(int num)
+{
+ int sum = 0;
+ while (num > 0)
+ {
+ sum += num % 10;
+ num /= 10;
+ }
+ return sum;
+}
+
+int product_of_digits(int num)
+{
+ int product = 1;
+ while (num > 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('assignment-s-02.c', 'assignment-s-02.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-02.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-02-c', 'assignment-s-02.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-02-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to reverse a non-negative integer using a function. */
+
+#include <stdio.h>
+
+int reverse(int);
+
+int main()
+{
+ int num;
+ printf("Enter a non-negetive integer: ");
+ scanf("%d", &num);
+ if (num < 0)
+ {
+ printf("\nOnly non-negetive integers are allowed.");
+ return 1;
+ }
+ printf("\nReverse of the integer %d = %d", num, reverse(num));
+ return 0;
+}
+
+int reverse(int num)
+{
+ int rev = 0;
+ while (num > 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('assignment-s-03.c', 'assignment-s-03.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-03.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-03-c', 'assignment-s-03.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-03-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int sum_of_series(int);
+
+int main()
+{
+ int n;
+ printf("Enter the n: ");
+ scanf("%d", &n);
+ printf("\nSum of the first %d terms of the series = %d", n, sum_of_series(n));
+ return 0;
+}
+
+int sum_of_series(int n)
+{
+ int sum = 0;
+ int i;
+ for (i = 1; i <= 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('assignment-s-04.c', 'assignment-s-04.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-04.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-04-c', 'assignment-s-04.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-04-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int isPrime(int);
+
+int main()
+{
+ int n, i;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+ if (isPrime(n))
+ {
+ printf("\nInput %d is a Prime Number.", n);
+ }
+ else
+ {
+ printf("\nInput %d is not a Prime Number.", n);
+ }
+ printf("\nPrime Numbers less than 100:");
+ for (i = 1; i < 100; i++)
+ {
+ if (isPrime(i))
+ {
+ printf(" %d", i);
+ }
+ }
+ return 0;
+}
+
+int isPrime(int n)
+{
+ if (n <= 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 <= 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('assignment-s-05.c', 'assignment-s-05.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-05.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-05-c', 'assignment-s-05.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-05-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a function to check whether a given string is a palindrome. Use this function to
+determine whether an entered string is Palindrome. */
+
+#include <stdio.h>
+#include <string.h>
+
+int isPalindrome(char[]);
+
+int main()
+{
+ char input[100];
+ int len;
+
+ printf("Enter the string (Max: 100 Character): ");
+ fgets(input, sizeof(input), stdin);
+ len = strlen(input);
+
+ if (len > 0 && input[len - 1] == '\n')
+ {
+ input[len - 1] = '\0';
+ }
+
+ if (isPalindrome(input))
+ {
+ printf("\nInput string \"%s\" is Palindrome.", input);
+ }
+ else
+ {
+ printf("\nInput string \"%s\" is not Palindrome", 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 < 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('assignment-s-06.c', 'assignment-s-06.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-06.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-06-c', 'assignment-s-06.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-06-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program using a function to compute and display all factors of a given number. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void display_factors(int);
+
+int main()
+{
+ int num, i;
+ printf("Please enter the number to get the factors from it : ");
+ scanf("%d", &num);
+ display_factors(num);
+ return 0;
+}
+
+void display_factors(int num) {
+ int temp = abs(num);
+ int i;
+
+ if (temp == 0)
+ {
+ printf("\n0 has infinitely many factors (all integers).");
+ exit(1);
+ }
+
+ printf("\nThe factors of ' %d ' is :- ", num);
+ printf("\nPositive : ");
+ for (i = 1; i <= temp; i++)
+ if (temp % i == 0)
+ printf(" %d", i);
+ printf("\nNegative : ");
+ for (i = 1; i <= temp; i++)
+ if (temp % i == 0)
+ printf(" %d", -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('assignment-s-07.c', 'assignment-s-07.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-07.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-07-c', 'assignment-s-07.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-07-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+// 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 'if' 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("--- Before Swap ---\n");
+ printf("Number 1 (num1): %d\n", num1);
+ printf("Number 2 (num2): %d\n", 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("\n--- After Swap (using macro) ---\n");
+ printf("Number 1 (num1): %d\n", num1);
+ printf("Number 2 (num2): %d\n", 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('assignment-s-08.c', 'assignment-s-08.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/assignment-secondary/assignment-s-08.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-assignment-secondary-assignment-s-08-c', 'assignment-s-08.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-assignment-secondary-assignment-s-08-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ int target[2], i, j, count[2], len;
+ for (target[0] = 'A', target[1] = 'a'; target[0] <= 'Z', target[1] <= 'z'; target[0]++, target[1]++)
+ {
+ count[0] = 0;
+ count[1] = 0;
+ for (i = 1; i < argc; i++)
+ {
+ len = strlen(argv[i]);
+ for (j = 0; j < len; j++)
+ {
+ if (argv[i][j] == target[0])
+ {
+ count[0]++;
+ }
+ if (argv[i][j] == target[1])
+ {
+ count[1]++;
+ }
+ }
+ }
+ if (count[0])
+ {
+ printf("\n\"%c\" found %d times.", target[0], count[0]);
+ }
+ if (count[1])
+ {
+ printf("\n\"%c\" found %d times.", target[1], count[1]);
+ }
+ }
+ return 0;
+}</div>
</div>
</div>
@@ -559,31 +2495,308 @@
<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('sudipto1.c', 'sudipto1.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/challenge/sudipto1.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-challenge-sudipto1-c', 'sudipto1.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-challenge-sudipto1-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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'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' 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 (&&, ||) 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 <stdio.h>
+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("------ Home Security Controller ------\n");
+ printf("Enter sensor states (1 for active, 0 for inactive).\n");
+ printf("Format: [Door] [Window] [Motion] [Glass Break]\n");
+ printf("Example: 0 1 1 0\n");
+ printf("Enter states (or press Ctrl+D for MacOS or Linux / Ctrl+Z for Windows to exit): ");
+
+ // doing the main calculation
+ // chacking the combined state and taking a decision
+ while (scanf("%d %d %d %d", &doorSensorState, &windowSensorState, &motionSensorState, &glassbreakSensorState) == 4)
+ {
+ // validating input
+ // The expression (variable & ~1) results in 0 only if 'variable' is 0 or 1.
+ // For any other positive number, it'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 & ~1) | (windowSensorState & ~1) | (motionSensorState & ~1) | (glassbreakSensorState & ~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 << 3) | (motionSensorState << 2) | (windowSensorState << 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 'default' case in the switch.
+ // We achieve this by multiplying the flag (which is > 0) by 16.
+ combinedState += invalidFlag * 16;
+
+ // printing the given state
+ printf("\n\nState : [Door : %d, Window : %d, Motion : %d, Glass Break : %d]\nState Id : %d",
+ doorSensorState, windowSensorState, motionSensorState, glassbreakSensorState, combinedState);
+ printf("\nSystem Action : ");
+
+ // taking decision based on combined state
+ // A single switch statement controls the program'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("System Idle. All sensors inactive.\n");
+ break;
+ case 1: // Binary: 0001
+ printf("Check front door camera.\n");
+ break;
+ case 2: // Binary: 0010
+ printf("Check window sensors.\n");
+ break;
+ case 3: // Binary: 0011
+ printf("Warning: Perimeter breach suspected. Check doors and windows.\n");
+ break;
+ case 4: // Binary: 0100
+ printf("Check interior cameras for movement.\n");
+ break;
+ case 5: // Binary: 0101
+ printf("Warning: Potential entry and movement detected. Check front door and interior. Ask for patrol.\n");
+ break;
+ case 6: // Binary: 0110
+ printf("Warning: Potential entry and movement detected. Check windows and interior. Ask for patrol.\n");
+ break;
+ case 7: // Binary: 0111
+ printf("Alert: High probability of unauthorized entry. Ask for patrol.\n");
+ break;
+ case 8: // Binary: 1000
+ printf("Alert: Glass break detected. High-priority event. Ask for patrol.\n");
+ break;
+ case 9: // Binary: 1001
+ printf("Severe Alert: Forced entry likely (door + glass). Activate Alarm and Contact authorities.\n");
+ break;
+ case 10: // Binary: 1010
+ printf("Severe Alert: Forced entry likely (window + glass). Activate Alarm and Contact authorities.\n");
+ break;
+ case 11: // Binary: 1011
+ printf("Intrusion Alert: Multiple perimeter breaches. Activate Alarm and Contact authorities.\n");
+ break;
+ case 12: // Binary: 1100
+ printf("Intrusion Alert: Confirmed interior presence after breach. Activate Alarm and Contact authorities.\n");
+ break;
+ case 13: // Binary: 1101
+ printf("INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n");
+ break;
+ case 14: // Binary: 1110
+ printf("INTRUSION CONFIRMED! Activate maximum response protocol. Activate Alarm and Contact authorities.\n");
+ break;
+ case 15: // Binary: 1111
+ printf("CATASTROPHIC EVENT! ALL SENSORS TRIGGERED. ACTIVATE ALARM AND CONTACT COPS.\n");
+ break;
+ default:
+ // This case should not be reached with valid 0/1 input but is included for completeness.
+ printf("Error: Invalid sensor state detected.\n");
+ break;
+ }
+
+ // discarding extra characters (if any) left
+ while (getchar() != '\n')
+ ;
+
+ // asking for next set of input
+ printf("\nEnter next set of states: ");
+ }
+ printf("\nSecurity system shutting down.\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('sudiptoown01.c', 'sudiptoown01.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/challenge/sudiptoown01.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-challenge-sudiptoown01-c', 'sudiptoown01.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-challenge-sudiptoown01-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+ * 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's behavior.
+ * 5. The program should handle all possible combinations of the sensors' 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 <stdio.h>
+
+int casekey(int door, int window, int motion, int glass) {
+ int key = (door << 3) | (window << 2) | (motion << 1) | glass;
+ return key;
+}
+
+int main() {
+ int door, window, motion, glass, key;
+ char choice;
+
+ static const char *action[16] = {
+ "IDLE", "CHECK WINDOW", "WARN MOTION", "WARN MOTION WINDOW",
+ "CHECK DOOR", "WARN DOOR WINDOW", "INTRUSION SUSPECTED", "INTRUSION CONFIRMED",
+ "GLASS ONLY", "DOOR GLASS", "MOTION GLASS", "MOTION WINDOW GLASS",
+ "DOOR WINDOW", "DOOR WINDOW GLASS", "DOOR MOTION GLASS", "ALL SENSORS"
+ };
+
+ do {
+ printf("Sensors: Door, Window, Motion, Glass\n");
+ printf("Enter the state of each sensor in binary (0 or 1): ");
+ scanf("%d %d %d %d", &door, &window, &motion, &glass);
+
+ key = casekey(door, window, motion, glass);
+ printf("Action: %s\n", action[key]);
+
+ printf("Want to continue? (y/n): ");
+ scanf(" %c", &choice);
+ printf("\n");
+ } while (choice == 'y' || choice == 'Y');
+
+ return 0;
+}</div>
</div>
</div>
@@ -602,31 +2815,143 @@
<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('KI001.c', 'KI001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/khurapati-idea/KI001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-khurapati-idea-KI001-c', 'KI001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-khurapati-idea-KI001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+// 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 <stdio.h>
+int main()
+{
+ // testing number
+ int num, len = -13 /* here minus 13 because we will remove the massage characters in line 10 */;
+ printf("Enter a number to get the length : ");
+ scanf("%d", &num);
+ len += printf("Your input : %d", num); // here the "Your input : ", this 13 characters are extra
+ printf("\nLength : %d", len);
+
+ // testing char
+ char a[20];
+ len = -13;
+ while (getchar() != '\n')
+ ;
+ printf("\nEnter a word to get the length : ");
+ scanf("%19s", &a);
+ len += printf("Your input : %s", a); // here the "Your input : ", this 13 characters are extra
+ printf("\nLength : %d", 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('KI002.c', 'KI002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/khurapati-idea/KI002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-khurapati-idea-KI002-c', 'KI002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-khurapati-idea-KI002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Author - Amit Dutta, Date - 05th November, 2025 */
+
+/* Plan - checking for edge case */
+
+#include <stdio.h>
+int main()
+{
+ printf("Starting.....\n");
+
+ for (int i = 1; ; i++)
+ {
+ printf("i = %d\n", i);
+ }
+ return 0;
+}</div>
</div>
</div>
@@ -645,969 +2970,6355 @@
<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('luc001.c', 'luc001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc001-c', 'luc001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ float f, c;
+ printf("Enter the temperature of city in Fahrenheit : ");
+ scanf("%f", &f);
+ // formula (F - 32) 5/9
+ c = ((f - 32) * 5) / 9;
+ printf("\nTemperature in centigrade : %f", 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('luc002.c', 'luc002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc002-c', 'luc002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double len, bre, r, area_r, per, area_c, cir;
+ printf("Enter the length and breadth of the rectangle : ");
+ scanf("%lf %lf", &len, &bre);
+ printf("Enter the Radius of the circle : ");
+ scanf("%lf", &r);
+ area_r = len * bre;
+ per = 2 * (len + bre);
+ area_c = M_PI * r * r;
+ cir = 2 * M_PI * r;
+ printf("\nArea of Rectangle : %lf"
+ "\nPerimeter of Rectangle : %lf"
+ "\nArea of Circle : %lf"
+ "\nCircumference of Circle : %lf",
+ 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('luc003.c', 'luc003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc003-c', 'luc003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+#include<math.h>
+int main() {
+ double s_long = 1189.0, s_short = 841.0, temp;
+ int i;
+ printf("A0 Dimension : %g mm x %g mm", floor(s_long), floor(s_short));
+ for (i = 1; i <= 8; i++) {
+ temp = s_long;
+ s_long = s_short;
+ s_short = temp / 2;
+ printf("\nA%d Dimension : %g mm x %g mm", 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('luc004.c', 'luc004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc004-c', 'luc004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* If a five digit number is input through the keyboard,
+write a program to calculate the sum of it'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 <stdio.h>
+int main()
+{
+ int inp, result = 0, i, temp;
+ printf("Enter a five digit number : ");
+ scanf("%d", &inp);
+ if (inp < 10000 || inp > 99999)
+ {
+ printf("\nPlease enter a valid five digit number.");
+ return 1;
+ }
+ temp = inp;
+ for (i = 1; i <= 5; i++)
+ {
+ result = result + (inp % 10);
+ inp = inp / 10;
+ }
+ printf("\nSum of the digit '%d' is : %d", 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('luc005.c', 'luc005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc005-c', 'luc005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double x, y, r, phi;
+ printf("Enter the Cartesian Co-Ordinates in this format 'x, y' : ");
+ scanf("%lf, %lf", &x, &y);
+ r = sqrt(pow(x, 2) + pow(y, 2));
+ phi = atan2(y, x);
+ printf("\nPolar Co-Ordinates are : (%g, %g Rad)", 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('luc006.c', 'luc006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc006-c', 'luc006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double l1, l2, g1, g2, d;
+ printf("Enter the Latitude in 'L1, L2' format : ");
+ scanf("%lf, %lf", &l1, &l2);
+ printf("Enter the Longitude in 'G1, G2' format : ");
+ scanf("%lf, %lf", &g1, &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("Distance in nautical miles : %g", 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('luc007.c', 'luc007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc007-c', 'luc007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double t, v, wcf;
+ printf("Enter the temperature and velociy of the wind : ");
+ scanf("%lf %lf", &t, &v);
+ wcf = 35.74 + (0.6215 * t) + (((0.4275 * t) - 35.75) * pow(v, 0.16));
+ printf("\nWind-chill factor (wcf) : %g", 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('luc008.c', 'luc008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc008-c', 'luc008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double inp, rsin, rcos, rtan, rcosec, rsec, rcot;
+ printf("Enter the Angle in degree : ");
+ scanf("%lf", &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("\nTrigonometric ratios :-"
+ "\nsin = %g "
+ "\ncos = %g"
+ "\ntan = %g"
+ "\ncosec = %g"
+ "\nsec = %g"
+ "\ncot = %g",
+ 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('luc009.c', 'luc009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc009-c', 'luc009.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double a, b;
+ printf("Enter the two number A and B : ");
+ scanf("%lf %lf", &a, &b);
+ printf("\nBefore Interchange : ");
+ printf("\nA = %g (Memory location = %p)", a, &a);
+ printf("\nB = %g (Memory location = %p)", b, &b);
+ a = a + b;
+ b = a - b;
+ a = a - b;
+ printf("\nAfter Interchange :");
+ printf("\nA = %g (Memory location = %p)", a, &a);
+ printf("\nB = %g (Memory location = %p)", b, &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('luc010.c', 'luc010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc010-c', 'luc010.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int num, rev, temp, i;
+ printf("Please enter the number : ");
+ scanf("%d", &num);
+ if (num < 10000 || num > 99999)
+ {
+ printf("\nPlease enter a five digit number.");
+ return 1;
+ }
+ temp = num;
+ for (i = 1; i <= 5; i++)
+ {
+ rev = (rev * 10) + num % 10;
+ num = num / 10;
+ }
+ printf("\nReverse of the Input number : %d", rev);
+ if (rev == temp)
+ printf("\nOriginal and reversed numbers are equal.");
+ else
+ printf("\nOrigianl and reversed numbers are not equal.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc011.c', 'luc011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc011-c', 'luc011.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int ram, shyam, ajay;
+ printf("Please enter the age of Ram, Shyam and Ajay : ");
+ scanf("%d %d %d", &ram, &shyam, &ajay);
+ if (ram == shyam || ram == ajay || shyam == ajay)
+ printf("\nThree must have different age.");
+ if (ram < shyam && ram < ajay)
+ printf("\nRam is the youngest. Age : %d", ram);
+ if (shyam < ram && shyam < ajay)
+ printf("\nShyam is the youngest. Age : %d", shyam);
+ if (ajay < ram && ajay < shyam)
+ printf("\nAjay is the youngest. Age : %d", 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('luc012.c', 'luc012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc012-c', 'luc012.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double angle1, angle2, angle3, sum;
+ printf("Enter the value of the three angle of the triangle : ");
+ scanf("%lf %lf %lf", &angle1, &angle2, &angle3);
+ sum = angle1 + angle2 + angle3;
+ if (sum == 180.0)
+ printf("\nThis Triangle is a valid one.");
+ else
+ printf("\nThis Triangle is not valid. Sum of the angles : %g", 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('luc013.c', 'luc013.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc013.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc013-c', 'luc013.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc013-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double num;
+ printf("Enter the number : ");
+ scanf("%lf", &num);
+ num = abs(num);
+ printf("\nAbsolute value of the input is : %g", 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('luc014.c', 'luc014.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc014.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc014-c', 'luc014.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc014-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Given the length and breadth of a rectangle, write a program to find
+whether the area of the rectangle is greater than it'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 <stdio.h>
+int main()
+{
+ double len, bre, area, peri;
+ printf("Enter the length and breadth of the rectangle : ");
+ scanf("%lf %lf", &len, &bre);
+ area = len * bre;
+ peri = 2 * (len + bre);
+ if (area > peri)
+ printf("\nThe area of the rectangle is greater than it's perimeter.");
+ else if (area < peri)
+ printf("\nThe area of the rectangle is lower than it's perimeter.");
+ else
+ printf("\nThe area of the rectangle is same as it's 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('luc015.c', 'luc015.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc015.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc015-c', 'luc015.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc015-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#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("Enter the point A(x1, y1) : ");
+ scanf("%lf %lf", &x1, &y1);
+ printf("Enter the point B(x2, y2) : ");
+ scanf("%lf %lf", &x2, &y2);
+ printf("Enter the point C(x3, y3) : ");
+ scanf("%lf %lf", &x3, &y3);
+ area = 0.5 * ((x1 * (y2 - y3)) + (x2 * (y3 - y1)) + (x3 * (y1 - y2)));
+ if (fabs(area) < EPSILON) // abs() for integer, fabs() for float, double
+ printf("\nA(%g, %g), B(%g, %g) and C(%g, %g) points fall on one straight line.", x1, y1, x2, y2, x3, y3);
+ else
+ printf("\nA(%g, %g), B(%g, %g) and C(%g, %g) points doesn't fall on one straight line.", 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('luc016.c', 'luc016.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc016.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc016-c', 'luc016.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc016-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+// 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("Enter the center coordinates (h, k) : ");
+ scanf("%lf %lf", &h, &k);
+ printf("Enter the radius (R) : ");
+ scanf("%lf", &R);
+ printf("Enter the point P coordinates (x, y) : ");
+ scanf("%lf %lf", &x, &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) < EPSILON)
+ {
+ printf("The point P(%g, %g) lies ON THE CIRCLE.\n", x, y);
+ }
+ // Case 2: Inside the circle (D^2 < R^2)
+ else if (distance_sq < radius_sq)
+ {
+ printf("The point P(%g, %g) lies INSIDE THE CIRCLE.\n", x, y);
+ }
+ // Case 3: Outside the circle (D^2 > R^2)
+ else
+ {
+ printf("The point P(%g, %g) lies OUTSIDE THE CIRCLE.\n", 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('luc017.c', 'luc017.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc017.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc017-c', 'luc017.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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>
- </div>
-
+ <!-- Embedded Code Storage -->
+ <div id="code-letusc-luc017-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#define EPSILON 0.00001
+
+int main()
+{
+ double x, y;
+ printf("Enter the point P(x, y) : ");
+ scanf("%lf %lf", &x, &y);
+ if (fabs(x) < EPSILON && fabs(y) < EPSILON)
+ printf("\nPoint P(%g, %g) lies on the origin.", x, y);
+ else if (fabs(x) < EPSILON)
+ printf("\nPoint P(%g, %g) lies on the Y-Axis.", x, y);
+ else if (fabs(y) < EPSILON)
+ printf("\nPoint P(%G, %g) lies on the X-Axis.", x, y);
+ else
+ printf("\nThe point P(%g, %g) lies in a QUADRANT (not on an axis or the origin).", 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('luc018-logic.c', 'luc018-logic.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc018-logic.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc018-logic-c', 'luc018-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc018-logic-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+/**
+ * @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 && 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[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
+
+ printf("Enter the year (e.g., 2025): ");
+ if (scanf("%lld", &year) != 1 || year < 1) {
+ printf("Invalid year input. Please enter a positive integer year (>= 1).\n");
+ 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 < 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("\nOn January 1st, %lld, the day was: **%s**.\n", 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('luc018.c', 'luc018.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc018.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc018-c', 'luc018.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc018-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int is_leap(int year) {
+ if ((year % 400 == 0) || (year % 4 == 0 && 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[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
+
+ printf("Enter the year (e.g., 2025): ");
+ if (scanf("%lld", &year) != 1 || year < 1) {
+ printf("Invalid year input. Please enter a positive integer year (>= 1).\n");
+ 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("\nOn January 1st, %lld, the day was: %s.\n", 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('luc019.c', 'luc019.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc019.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc019-c', 'luc019.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc019-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+#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("Please enter the length of three side of the triangle : ");
+ scanf("%lf %lf %lf", &side1, &side2, &side3);
+ if (side1 < 1 || side2 < 1 || side3 < 1)
+ {
+ printf("\nLength of a side of triangle should be a positive integer.");
+ return 1;
+ }
+ if (side1 + side2 < side3 || side1 + side3 < side2 || side2 + side3 < side1)
+ {
+ printf("\nEntered triangle is not VALID.");
+ return 1;
+ }
+ // isosceles check
+ if (side1 == side2 || side2 == side3 || side3 == side1)
+ printf("\nEntered triangle is a ISOSCELES triangle.");
+ else
+ printf("\nEntered triangle is NOT a ISOSCELES triangle.");
+ // equilateral check
+ if (side1 == side2 && side2 == side3)
+ printf("\nEntered triangle is a EQUILATERAL triangle.");
+ else
+ printf("\nEntered triangle is NOT a EQUILATERAL triangle.");
+ // scalene check
+ if (side1 != side2 && side2 != side3)
+ printf("\nEntered triangle is a SCALENE triangle.");
+ else
+ printf("\nEntered triangle is NOT a SCALENE triangle.");
+ // right-angle check
+ if (fabs(((side1 * side1) + (side2 * side2)) - (side3 * side3)) < EPSILON ||
+ fabs(((side2 * side2) + (side3 * side3)) - (side1 * side1)) < EPSILON ||
+ fabs(((side3 * side3) + (side1 * side1)) - (side2 * side2)) < EPSILON)
+ printf("\nEntered triangle is a RIGHT-ANGLED triangle.");
+ else
+ printf("\nEntered triangle is NOT a RIGHT-ANGLED triangle.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc020.c', 'luc020.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc020.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc020-c', 'luc020.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc020-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+// declaring function
+double get_white(double red, double green, double blue)
+{
+ double max;
+ max = red / 255;
+ if (max < (green / 255))
+ max = green / 255;
+ if (max < (blue / 255))
+ max = blue / 255;
+ return max;
+}
+
+int main()
+{
+ double r, g, b, w, c = 0, m = 0, y = 0, k = 0;
+ printf("Enter the RGB color code in 'R G B' format : ");
+ scanf("%lf %lf %lf", &r, &g, &b);
+
+ // checking for invalid input (negetive input)
+ if (r < 0 || g < 0 || b < 0)
+ {
+ printf("\nRGB color code can not be a negetive number.");
+ return 1;
+ }
+
+ // checking for invalid input (out of range color code)
+ if (r > 255 || g > 255 || b > 255)
+ {
+ printf("\nRGB color code can be maximum (255, 255, 255).");
+ return 1;
+ }
+
+ // converting RGB color code to CMYK color code
+ if (r == 0 && g == 0 && 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("\nRGB color (%g, %g, %g) equivalent to CMYK color (%g, %g, %g, %g).", 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('luc021.c', 'luc021.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc021.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc021-c', 'luc021.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc021-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double hardness, carbon_content, tensile_strength;
+ printf("Enter the details of the steel below - \n");
+ printf("1. Hardness : ");
+ scanf("%lf", &hardness);
+ printf("2. Carbon Content : ");
+ scanf("%lf", &carbon_content);
+ printf("3. Tensile Strength : ");
+ scanf("%lf", &tensile_strength);
+
+ // storing how many conditions are met as boolean result
+ int condition_met, condition1, condition2, condition3;
+ condition1 = hardness > 50;
+ condition2 = carbon_content < 0.7;
+ condition3 = tensile_strength > 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 && condition2)
+ grade = 9;
+ else if (condition2 && condition3)
+ grade = 8;
+ else if (condition1 && condition3)
+ grade = 7;
+ }
+ else if (condition_met == 1)
+ grade = 6;
+ else
+ grade = 5;
+
+ // printing the result
+ printf("\n------------- Result -------------");
+ printf("\n1. Hardness : Condition %s", condition1 ? "MET" : "DID NOT MET");
+ printf("\n2. Carbon Content : Condition %s", condition2 ? "MET" : "DID NOT MET");
+ printf("\n3. Tensile Strength : Condition %s", condition3 ? "MET" : "DID NOT MET");
+ printf("\nTotal Condition Met : %d", condition_met);
+ printf("\n\nGrade : %d\n\n", 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('luc022.c', 'luc022.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc022.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc022-c', 'luc022.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc022-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 < 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 >= 40
+*/
+/* Author - Amit Dutta, Date - 4th OCT, 2025 */
+/* Let Us C, Chap- 4, Page - 72, Qn No.: D(d) */
+
+#include <stdio.h>
+
+int main()
+{
+ double weight, height, bmi;
+ printf("Enter your Weight (in Kilograms) and Height (in Meters) : ");
+ scanf("%lf %lf", &weight, &height);
+ bmi = weight / (height * height);
+ printf("\nCalculated BMI : %g", bmi);
+ if (bmi < 15)
+ printf("\nBMI Catagory : Starvation");
+ else if (bmi >= 15.1 && bmi <= 17.5)
+ printf("\nBMI Catagory : Anorexic");
+ else if (bmi >= 17.6 && bmi <= 18.5)
+ printf("\nBMI Catagory : Underweight");
+ else if (bmi >= 18.6 && bmi <= 24.9)
+ printf("\nBMI Catagory : Ideal");
+ else if (bmi >= 25 && bmi <= 25.9)
+ printf("\nBMI Catagory : Overweight");
+ else if (bmi >= 30 && bmi <= 39.9)
+ printf("\nBMI Catagory : Obese");
+ else if (bmi >= 40)
+ printf("\nBMI Catagory : Morbidly Obese");
+ else
+ printf("\nBMI Catagory : Unclassified");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc023.c', 'luc023.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc023.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc023-c', 'luc023.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc023-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ char inp;
+ printf("Enter the character : ");
+ scanf("%c", &inp);
+ printf("\nInput Character '%c' is %s a LOWER CASE ALPHABET.", inp,
+ (inp >= 'a' && inp <= 'z') ? "" : "NOT");
+ printf("\nInput Character '%c' is %s a SPECIAL SYMBOL.", inp,
+ (inp >= 'a' && inp <= 'z' || inp >= 'A' && inp <= 'Z'
+ || inp >= '0' && inp <= '9') ? "NOT" : "");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc024.c', 'luc024.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc024.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc024-c', 'luc024.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc024-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &year);
+ printf("\nYear %d is %s a Leapyear.", year, (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) ? "" : "NOT");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc025.c', 'luc025.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc025.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc025-c', 'luc025.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc025-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double num1, num2, num3, max;
+ printf("Enter three number : ");
+ scanf("%lf %lf %lf", &num1, &num2, &num3);
+ printf("\nGreatest of the three number '%g', '%g' and '%g' is : '%g'", num1, num2, num3,
+ (num1 > num2 && num1 > num3) ? num1 : ((num2 > num1 && num2 > 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('luc026.c', 'luc026.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc026.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc026-c', 'luc026.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc026-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#define EPSILON 0.0000001
+
+int main()
+{
+ double angle, result;
+ printf("Enter the angle value in degree : ");
+ // checking if the input is other than number.
+ if(scanf("%lf", &angle) != 1) {
+ printf("\nPlease enter a number.");
+ return 1;
+ }
+ angle = angle * (M_PI / 180); // converting degree to radian
+ result = pow(sin(angle), 2) + pow(cos(angle), 2);
+ (fabs(result - 1.0) < EPSILON) ?
+ printf("\nsum of squares of sine and cosine of this angle is equal to 1.") :
+ printf("\nsum of squares of sine and cosine of this angle is NOT equal to 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('luc027.c', 'luc027.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc027.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc027-c', 'luc027.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc027-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Rewrite the folowing program using conditional operations
+ #include<stdio.h>
+ int main()
+ {
+ float sal;
+ printf("Enter the salary");
+ scanf("%f", &sal);
+ if(sal >= 25000 && sal <= 40000)
+ printf("Manager\n");
+ else
+ if(sal >= 15000 && sal < 25000)
+ printf("Accountant\n");
+ else
+ printf("Clerk\n");
+ return 0;
+ }
+*/
+/* Author - Amit Dutta, Date - 6th OCT, 2025 */
+/* Let Us C, Chap- 4, Page - 73, Qn No.: E(e) */
+
+#include <stdio.h>
+int main()
+{
+ float sal;
+ printf("Enter the salary");
+ scanf("%f", &sal);
+ (sal >= 25000 && sal <= 40000) ? printf("Manager\n") :
+ ((sal >= 15000 && sal < 25000) ? printf("Accountant\n") : printf("Clerk\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('luc028.c', 'luc028.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc028.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc028-c', 'luc028.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc028-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int i = 0;
+ printf("ASCII Value\tCharacter");
+ printf("\n-----------\t---------\n");
+ while (i <= 255)
+ {
+ printf("%d.\t%c\n\n", 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('luc029.c', 'luc029.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc029.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc029-c', 'luc029.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc029-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ int num = 100, temp1, temp2, res;
+ printf("Armstrong numbers between 100 and 500 :");
+ while (num <= 500)
+ {
+ temp1 = num;
+ res = 0;
+ while (temp1 != 0)
+ {
+ temp2 = temp1 % 10;
+ res = res + pow(temp2, 3);
+ temp1 = temp1 / 10;
+ }
+ if (num == res)
+ printf(" %d", 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('luc030.c', 'luc030.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc030.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc030-c', 'luc030.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc030-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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's pick and the
+computer's pick equal to 5 in each round. This forces the player
+to pick the final matchstick. */
+
+#include <stdio.h>
+int main()
+{
+ int remaining_matchsticks = 21, player_pick, computer_pick;
+ printf(" --- Matchstick Game ---\n");
+ printf("Rules: There are 21 matchsticks. You can pick 1, 2, 3, or 4.\n");
+ printf("Whoever is forced to pick the last matchstick loses the game.\n");
+ while (remaining_matchsticks > 1)
+ {
+ // game start
+ printf("\n--------------------------");
+ printf("\nRemaining Matchsticks : %d", remaining_matchsticks);
+
+ // player pick and checking input is valid or not
+ printf("\nYour turn: Pick 1, 2, 3, or 4 matchsticks: ");
+ if (scanf("%d", &player_pick) != 1)
+ {
+ printf("\n\tPlease enter a number.");
+ while (getchar() != '\n')
+ ;
+ continue;
+ }
+
+ // checking player pick is valid or not
+ if (player_pick < 1 || player_pick > 4)
+ {
+ printf("\n\tPlease enter a number among 1, 2, 3 and 4.");
+ while (getchar() != '\n')
+ ;
+ continue;
+ }
+
+ if (player_pick > remaining_matchsticks)
+ {
+ printf("\nInvalid choice! There are not enough matchsticks left.");
+ while (getchar() != '\n')
+ ;
+ continue;
+ }
+
+ // computer_picks
+ computer_pick = 5 - player_pick;
+ printf("\ncomputer_picks : %d", computer_pick);
+
+ // remaining matchsticks
+ remaining_matchsticks = remaining_matchsticks - (player_pick + computer_pick);
+ }
+
+ // game over
+ printf("\n----------------------------------\n");
+ printf("Only 1 matchstick is left.\n");
+ printf("You are forced to pick the last matchstick. You lose!\n");
+ printf("The computer wins.\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('luc031-logic.c', 'luc031-logic.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc031-logic.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc031-logic-c', 'luc031-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc031-logic-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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's input as a generic string (char array).
+ * This allows the program to accept multi-digit numbers (e.g., "-500") or the command ('n').
+ * 4. TERMINATION CHECK: Immediately check if the input string is exactly "n" using strcmp().
+ * If true, the user wants to quit, so break the loop.
+ * 5. VALIDATION & CONVERSION: If the input is not "n", 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 > 0, increment positive_count.
+ * - If the number is < 0, increment negative_count.
+ * - If the number is == 0, increment zero_count.
+ * 7. ERROR HANDLING: If the input is neither "n" 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 <stdio.h>
+#include <stdlib.h> // for strtol
+#include <string.h> // 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's input as a string (e.g., "123", "-50", or "n")
+ char input_buffer[MAX_INPUT_LEN];
+ int number;
+
+ printf("--- Number Analyzer ---\n");
+ printf("Enter numbers one by one. Type 'n' and press Enter to finish.\n\n");
+
+ // Loop until the user enters 'n'
+ while (1) {
+ printf("Enter number or 'n': ");
+
+ // 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 '\n' if the input was shorter than MAX_INPUT_LEN
+ size_t len = strlen(input_buffer);
+ if (len > 0 && input_buffer[len - 1] == '\n') {
+ input_buffer[len - 1] = '\0';
+ }
+
+ // 1. Check for the termination condition
+ if (strcmp(input_buffer, "n") == 0) {
+ printf("\n'n' received. Stopping input...\n");
+ 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 "%d" (decimal integer)
+ // It returns 1 if a number was successfully read.
+ int conversions = sscanf(input_buffer, "%d", &number);
+
+ if (conversions == 1) {
+ // Conversion was successful, now check the number's sign
+ if (number > 0) {
+ positive_count++;
+ } else if (number < 0) {
+ negative_count++;
+ } else {
+ zero_count++;
+ }
+ printf(" -> Number recorded: %d\n", number);
+ } else {
+ // Conversion failed. The input was neither 'n' nor a valid integer.
+ printf(" -> Invalid input. Please enter a valid number or 'n'.\n");
+ }
+ }
+
+ // Display the final results
+ printf("\n====================================\n");
+ printf(" Analysis Complete\n");
+ printf("====================================\n");
+ printf("Positive numbers entered: %d\n", positive_count);
+ printf("Negative numbers entered: %d\n", negative_count);
+ printf("Zeroes entered: %d\n", zero_count);
+ printf("Total numbers recorded: %d\n", positive_count + negative_count + zero_count);
+ printf("====================================\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('luc031.c', 'luc031.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc031.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc031-c', 'luc031.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc031-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int choice = 1, num, positive_count = 0, negative_count = 0, zero_count = 0;
+ while (choice == 1)
+ {
+ printf("\nEnter the number (Type any character and press Enter to finish.) : ");
+ choice = scanf("%d", &num); // Checking whether the user has input any characters
+ if (choice == 1)
+ {
+ printf("Number recorded : %d", num);
+ if (num < 0)
+ negative_count++;
+ else if (num > 0)
+ positive_count++;
+ else if (num == 0)
+ zero_count++;
+ }
+ else
+ {
+ // If the user inputs any characters, then choice = 0, it means he doesn't want to give any more input;
+ choice = 0;
+ printf("\nCharacter received. Stopping input...\n");
+ }
+ }
+ // Display the final results
+ printf("\n====================================\n");
+ printf(" Analysis Complete\n");
+ printf("====================================\n");
+ printf("Positive numbers entered: %d\n", positive_count);
+ printf("Negative numbers entered: %d\n", negative_count);
+ printf("Zeroes entered: %d\n", zero_count);
+ printf("Total numbers recorded: %d\n", positive_count + negative_count + zero_count);
+ printf("====================================\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('luc032.c', 'luc032.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc032.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc032-c', 'luc032.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc032-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int octal[20], decimal, index = 0, temp, rem;
+ printf("Enter the decimal number : ");
+ scanf("%d", &decimal);
+ temp = decimal;
+ while (temp != 0)
+ {
+ rem = temp % 8;
+ temp = temp / 8;
+ octal[index] = rem;
+ index++;
+ }
+ printf("\nDeciaml %d to octal : ", decimal);
+ while ((index - 1) >= 0)
+ {
+ printf("%d", 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('luc033.c', 'luc033.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc033.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc033-c', 'luc033.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc033-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int choice = 1, set_of_numbers[30], num, index = -1;
+ while (choice == 1)
+ {
+ printf("\nEnter the number (Type any character and press Enter to finish.) : ");
+ choice = scanf("%d", &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't want to give any more input;
+ choice = 0;
+ printf("\nCharacter received. Stopping input...\n");
+ break;
+ }
+ index++;
+ set_of_numbers[index] = num;
+ }
+ int max = set_of_numbers[0], min = set_of_numbers[0];
+ while (index >= 0)
+ {
+ if (max < set_of_numbers[index])
+ max = set_of_numbers[index];
+ if (min > set_of_numbers[index])
+ min = set_of_numbers[index];
+ index--;
+ }
+ int range = max - min;
+ printf("\nBiggest number in the set : %d", max);
+ printf("\nSmallest number in the set : %d", min);
+ printf("\nRange : %d", 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('luc034.c', 'luc034.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc034.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc034-c', 'luc034.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc034-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int i, num, res;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ printf("\n--- Multiplication Table ---\n");
+ for (i = 1; i <= 10; i++)
+ printf("%d * %d = %d\n", 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('luc035.c', 'luc035.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc035.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc035-c', 'luc035.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc035-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double y, x;
+ printf("\n--- Approximate Intelligence ---\n");
+ for (y = 1; y <= 6; y++)
+ {
+ printf("\tY = %d\n", y);
+ for (x = 5.5; x <= 12.5; x += 0.5)
+ {
+ printf("Y: %g\t X: %.2g\t I: %g\n", y, x, 2 + (y + 0.5 * x));
+ }
+ printf("-----------------------\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('luc036.c', 'luc036.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc036.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc036-c', 'luc036.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc036-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 & q and calculate the
+corresponding as' */
+/* 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 "https://github.com/notamitgamer/bsc/issues" with the updated code.
+
+#include <stdio.h>
+#include <math.h>
+int main()
+{
+ double interest, principalAmount, interestRate, timeInYears, compoundFactor, totalAmount;
+ int index;
+ for (index = 1; index <= 10; index++)
+ {
+ printf("Enter Principle amount : ");
+ scanf("%lf", &principalAmount);
+ printf("Enter Rate of Interest : ");
+ scanf("%lf", &interestRate);
+ interestRate *= 0.01;
+ printf("Enter the Time (Years) : ");
+ scanf("%lf", &timeInYears);
+ printf("Compound count in one year : ");
+ scanf("%lf", &compoundFactor);
+ totalAmount = (principalAmount * pow((1 + interestRate / compoundFactor), (timeInYears * compoundFactor)));
+ interest = totalAmount - principalAmount;
+ printf("\nInterest : %.2f\nTotal Amount : %.2f\n\n", 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('luc037.c', 'luc037.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc037.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc037-c', 'luc037.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc037-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+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 <= 7; i++)
+ {
+ result += 0.5 * pow(((x - 1) / x), i);
+ }
+ return result;
+}
+
+int main()
+{
+ double x;
+ printf("Enter the value for x : ");
+ scanf("%lf", &x);
+ printf("\nResult : %g", 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('luc038.c', 'luc038.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc038.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc038-c', 'luc038.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc038-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int a, b, c;
+ printf("Pythagorean Triplets with slide length less than or equal to 30 : \n");
+ for (a = 1; a <= 30; a++)
+ {
+ for (b = a; b <= 30; b++)
+ {
+ int c_square = a * a + b * b;
+ for (c = b + 1; c <= 30; c++)
+ {
+ if (c * c == c_square)
+ printf("(%d, %d, %d)\n", 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('luc039.c', 'luc039.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc039.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc039-c', 'luc039.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc039-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int i, population = 100000;
+ printf("Present year : %d\n", population);
+ for (i = 1; i <= 10; i++)
+ {
+ population /= 1.10;
+ printf("%d year ago : %d\n", 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('luc040-logic.c', 'luc040-logic.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc040-logic.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc040-logic-c', 'luc040-logic.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc040-logic-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h> // 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 'long long' because cubes (like 47^3) are large and can exceed
+ // the capacity of a standard 'int', 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("Ramanujan Number Finder (a^3 + b^3 = c^3 + d^3)\n");
+ printf("Searching up to %d (Max base value is %d)\n", LIMIT, MAX_BASE_VAL);
+ printf("---------------------------------------------------\n");
+
+ // 5. OUTER LOOPS: Establishing the FIRST SUM (a^3 + b^3 = sum1)
+
+ // Loop for 'a' (the smaller base of the first pair)
+ for (int a = 1; a <= MAX_BASE_VAL; a++)
+ {
+
+ // Loop for 'b' (the larger base of the first pair)
+ // We start 'b' at 'a + 1' to enforce the rule a < b.
+ // This prevents us from checking redundant pairs like (1, 12) and (12, 1).
+ for (int b = a + 1; b <= 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 'long long' type.
+ sum1 = (long long)a * a * a + (long long)b * b * b;
+
+ // Optimization 1: Check if the sum exceeds the global limit.
+ if (sum1 > LIMIT)
+ {
+ // Since 'b' is increasing, any further increase will also be over the limit.
+ // We stop the 'b' loop and move to the next 'a'.
+ break;
+ }
+
+ // Reset the flag for every new sum1.
+ // We start searching for a second way for this new 'sum1', 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 'c' (the smaller base of the second pair)
+ // We start 'c' at 'a + 1' to enforce the rule a < 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 <= MAX_BASE_VAL; c++)
+ {
+
+ // Optimization 2: Check the flag to exit the 'c' loop early.
+ if (found_match)
+ {
+ // If we already found the second way (c, d) in a previous iteration of 'c', stop searching and move to the next (a, b) pair.
+ break;
+ }
+
+ // Loop for 'd' (the larger base of the second pair)
+ // We start 'd' at 'c + 1' to enforce c < d.
+ for (int d = c + 1; d <= 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 > sum1)
+ {
+ // Since 'd' is increasing, any further increase will also be greater than sum1.
+ // We stop the 'd' loop and move to the next 'c'.
+ 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("[%d] %lld = %d^3 + %d^3 = %d^3 + %d^3\n",
+ count, sum1, a, b, c, d);
+
+ // Set the flag to 1, confirming we found the second way.
+ found_match = 1;
+
+ // Stop the 'd' loop immediately, as we found the required second pair.
+ break;
+ }
+ }
+ // If found_match was set to 1, the 'break' in the d loop will execute,
+ // then the 'if (found_match) break;' in the c loop will execute,
+ // and the program will move to the next (a, b) pair.
+ }
+ }
+ }
+
+ // 8. CONCLUSION
+ printf("---------------------------------------------------\n");
+ printf("Search complete. Found %d Ramanujan-type numbers.\n", 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('luc040.c', 'luc040.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc040.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc040-c', 'luc040.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc040-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+#define limit 100000
+#define max_base 47
+
+int main()
+{
+
+ long long sum1, sum2;
+ int count = 0;
+
+ printf("Ramanujan numbers : \n");
+
+ int found_match;
+
+ for (int a = 1; a <= max_base; a++)
+ {
+ for (int b = a + 1; b <= max_base; b++)
+ {
+ sum1 = (long long)a * a * a + (long long)b * b * b;
+ if (sum1 > limit)
+ {
+ break;
+ }
+
+ found_match = 0;
+
+ for (int c = a + 1; c <= max_base; c++)
+ {
+ if (found_match)
+ {
+ break;
+ }
+ for (int d = c + 1; d <= max_base; d++)
+ {
+ sum2 = (long long)c * c * c + (long long)d * d * d;
+ if (sum2 > sum1)
+ {
+ break;
+ }
+ if (sum1 == sum2)
+ {
+ count++;
+ printf("(%d.) %lld = %d^3 + %d^3 = %d^3 + %d^3\n", count, sum1, a, b, c, d);
+
+ found_match = 1;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ printf("-------------------------------\n");
+ printf("Search complete.");
+
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('luc041.c', 'luc041.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc041.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc041-c', 'luc041.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc041-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int hour, temp;
+ printf("Time \tSuffix\n");
+ for (int hour = 0; hour <= 23; hour++)
+ {
+ if (hour == 0)
+ printf("12:00\tAM (Midnight)\n");
+ else if (hour == 12)
+ printf("12:00\tPM (Noon)\n");
+ else if (hour >= 1 && hour <= 11)
+ printf("%02d:00\tAM\n", hour);
+ else if (hour >= 13 && hour <= 23)
+ printf("%02d:00\tPM\n", 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('luc042.c', 'luc042.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc042.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc042-c', 'luc042.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc042-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int starter = 1;
+ int tab = 3;
+ printf("The pattern : \n");
+ for (int i = 1; i <= 4; i++)
+ {
+ int count = 0;
+ for (int k = 1; k <= tab; k++)
+ {
+ printf(" ");
+ }
+ tab = tab - 1;
+ for (int j = starter; j <= 10; j++)
+ {
+ if (count >= i)
+ {
+ break;
+ }
+ printf("%d ", j);
+ count++;
+ starter++;
+ }
+ printf("\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('luc043.c', 'luc043.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc043.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc043-c', 'luc043.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc043-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int studentClass, failedSubjectCount, graceMarks = 0;
+ printf("Class obtained by the student (Enter 1 for First Class, 2 for Second Class, 3 for Third Class): ");
+ scanf("%d", &studentClass);
+ printf("Failed Subject Count: ");
+ scanf("%d", &failedSubjectCount);
+
+ if (failedSubjectCount < 0) {
+ printf("\nFailed subject count cannot be negative.");
+ return 1;
+ }
+
+ switch (studentClass)
+ {
+ case 1:
+ if (failedSubjectCount <= 3)
+ {
+ graceMarks += 5 * failedSubjectCount;
+ }
+ break;
+
+ case 2:
+ if (failedSubjectCount <= 2)
+ {
+ graceMarks += 4 * failedSubjectCount;
+ }
+ break;
+
+ case 3:
+ if (failedSubjectCount <= 1)
+ {
+ graceMarks += 5 * failedSubjectCount;
+ }
+ break;
+
+ default:
+ printf("\nWrong Choice.");
+ return 1;
+ }
+
+ printf("\nStudent will get %d grace marks.", 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('luc044.c', 'luc044.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc044.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc044-c', 'luc044.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc044-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int leapYear(int);
+
+int leapYear(int year)
+{
+ if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)))
+ return 1;
+ else
+ return 0;
+}
+
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &year);
+ if (leapYear(year))
+ printf("\nYear %d is a Leap Year.", year);
+ else
+ printf("\nYear %d is not a Leap Year.", 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('luc045.c', 'luc045.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc045.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc045-c', 'luc045.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc045-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+void findPrimeFactors(int n)
+{
+ int temp_n = n;
+
+ if (temp_n == 1)
+ {
+ printf("Prime factors of %d are: None.\n", n);
+ return;
+ }
+
+ printf("Prime factors of %d are:", n);
+
+ while (temp_n % 2 == 0)
+ {
+ printf(" %d", 2);
+ temp_n = temp_n / 2;
+ }
+
+ for (int i = 3; i <= (int)sqrt(temp_n); i = i + 2)
+ {
+ while (temp_n % i == 0)
+ {
+ printf(" %d", i);
+ temp_n = temp_n / i;
+ }
+ }
+
+ if (temp_n > 2)
+ {
+ printf(" %d", temp_n);
+ }
+
+ printf("\n");
+}
+
+int main()
+{
+ int n;
+ printf("Enter a positive integer to get the prime factors: ");
+ if (scanf("%d", &n) != 1)
+ {
+ printf("Error: Invalid input. Please enter an integer.\n");
+ return 1;
+ }
+ if (n <= 0)
+ {
+ printf("Error: Please enter a POSITIVE integer.\n");
+ 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('luc046.c', 'luc046.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc046.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc046-c', 'luc046.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc046-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void circularShift(int *, int *, int *);
+
+int main()
+{
+ int x = 5, y = 8, z = 10;
+
+ printf("--- Before Shift ---\n");
+ printf("x: %d, y: %d, z: %d", x, y, z);
+
+ circularShift(&x, &y, &z);
+
+ printf("\n--- After Shift ---\n");
+ printf("x: %d, y: %d, z: %d", 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('luc047.c', 'luc047.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc047.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc047-c', 'luc047.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc047-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void convertWeight(double, double *, double *, double *);
+
+int main()
+{
+ double weightGram, weightPound, weightKG, weightTON;
+ printf("Enter the weight of the comodity in Kilogram(s): ");
+ scanf("%lf", &weightKG);
+
+ convertWeight(weightKG, &weightGram, &weightPound, &weightTON);
+ printf("\n%g Kilogram(s) = %.04f Gram(s)"
+ "\n%g Kilogram(s) = %.04f Pound(s)"
+ "\n%g Kilogram(s) = %.04f TON(s)",
+ 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('luc048.c', 'luc048.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/luc048.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-luc048-c', 'luc048.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-luc048-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+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("--- Compute the distance between two points ---\n\n");
+ printf("Enter the co-ordinates of Point 1 (Ex.: 5,6): ");
+ scanf("%lf,%lf", &x1, &y1);
+ printf("Enter the co-ordinates of Point 2 (Ex.: 3,4): ");
+ scanf("%lf,%lf", &x2, &y2);
+
+ distance(x1, y1, x2, y2, &result_Distance);
+ printf("\nDistance between P1(%g, %g) and P2(%g, %g) = %g",
+ 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("\n\n--- Compute the area of a triangle ABC ---\n\n");
+ printf("Enter the co-ordinates of Point A (Ex.: 5,6): ");
+ scanf("%lf,%lf", &x1, &y1);
+ printf("Enter the co-ordinates of Point B (Ex.: 3,4): ");
+ scanf("%lf,%lf", &x2, &y2);
+ printf("Enter the co-ordinates of Point C (Ex.: 6,7): ");
+ scanf("%lf,%lf", &x3, &y3);
+
+ area(x1, y1, x2, y2, x3, y3, &result_Area);
+ printf("\nArea of the A(%g, %g), B(%g, %g), C(%g, %g) = %g",
+ 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("\n\n--- Check if a test point P(x, y) lies strictly inside the triangle ABC ---\n\n");
+ printf("Do you wish to use previous entered triangle?"
+ "\nIf Yes, type 'Y'; If No, type 'N': ");
+ scanf(" %c", &choice);
+ choice = toupper(choice);
+ switch (choice)
+ {
+ case 'Y':
+ break;
+ case 'N':
+ printf("Enter the co-ordinates of Point A (Ex.: 5,6): ");
+ scanf("%lf,%lf", &x1, &y1);
+ printf("Enter the co-ordinates of Point B (Ex.: 3,4): ");
+ scanf("%lf,%lf", &x2, &y2);
+ printf("Enter the co-ordinates of Point C (Ex.: 6,7): ");
+ scanf("%lf,%lf", &x3, &y3);
+ break;
+ default:
+ printf("\nYou entered invalid choice.");
+ break;
+ }
+ printf("Enter the co-ordinates of Test Point (Ex.: 3,5): ");
+ scanf("%lf,%lf", &x, &y);
+
+ if (is_inside(x, y, x1, y1, x2, y2, x3, y3))
+ printf("\nTest Point (%g, %g) is inside ABC.", x, y);
+ else
+ printf("\nTest Point (%g, %g) is not inside ABC.", 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, &ab);
+ distance(x2, y2, x3, y3, &bc);
+ distance(x1, y1, x3, y3, &ac);
+
+ s = (ab + bc + ac) / 2.0;
+ double area_sq = s * (s - ab) * (s - bc) * (s - ac);
+
+ if (area_sq < 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, &area_ABC);
+ area(x, y, x1, y1, x2, y2, &area_PAB);
+ area(x, y, x2, y2, x3, y3, &area_PBC);
+ area(x, y, x1, y1, x3, y3, &area_PAC);
+
+ double sum_of_sub_areas = area_PAB + area_PBC + area_PAC;
+
+ if (fabs(area_ABC - sum_of_sub_areas) < EPSILON)
+ return 1;
+ else
+ return 0;
+}
+
+/*
+ *************** SAMPLE OUTPUT ***************
+
+PS G:\bsc\letusc> ./*.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 'Y'; If No, type 'N': 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('lucproblem001.c', 'lucproblem001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem001-c', 'lucproblem001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int n, nonotes, temp;
+ printf("Enter the amount : ");
+ scanf("%d", &n);
+ if (n < 1)
+ {
+ printf("\nAmount should be a positive integer.");
+ 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("\nthe smallest number of notes that will combine to give Rs. %d : %d", 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('lucproblem002.c', 'lucproblem002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem002-c', 'lucproblem002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* A year is entered through the keyboard, write a program to
+determine whether the year is leap or not. Use the logical operators
+&& and || . */
+/* Author - Amit Dutta, Date - 02th OCT, 2025 */
+/* Let Us C, Chap - 4, Page - 64, Problem 4.1 */
+
+#include <stdio.h>
+int main()
+{
+ int year;
+ printf("Enter year : ");
+ scanf("%d", &year);
+ if (year % 4 == 0 && year & 100 != 0 || year % 400 == 0)
+ printf("\nYear %d is a leapyear.", year);
+ else
+ printf("\nYear %d is not a leapyear.", 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('lucproblem003.c', 'lucproblem003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem003-c', 'lucproblem003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ char inp;
+ printf("Enter one character : ");
+ scanf(" %c", &inp);
+ if (inp >= 64 && inp <= 90)
+ printf("\nInput '%c' is a CAPITAL LETTER.", inp);
+ if (inp >= 97 && inp <= 122)
+ printf("\nInput '%c' is a SMALL CASE LETTER.", inp);
+ if (inp >= 48 && inp <= 57)
+ printf("\nInput '%c' is a DIGIT.", inp);
+ if (inp >= 0 && inp <= 47 || inp >= 58 && inp <= 64
+ || inp >= 91 && inp <= 96 || inp >= 123 && inp <= 127)
+ printf("\nInput '%c' is a SPECIAL SYMBOL.", 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('lucproblem004.c', 'lucproblem004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem004-c', 'lucproblem004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double side1, side2, side3;
+ printf("Enter the length of side1, side2 and side3 of the triangle : ");
+ scanf("%lf %lf %lf", &side1, &side2, &side3);
+ if (side1 <= 0 || side2 <= 0 || side3 <= 0)
+ {
+ printf("\nTriangle sides must be positive.\n");
+ return 1;
+ }
+ if ((side1 + side2 > side3) && (side1 + side3 > side2) && (side2 + side3 > side1))
+ // Triangle Inequality Theorem
+ printf("\nThis triangle is valid.");
+ else
+ printf("\nThis triangle is not valid.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('lucproblem005.c', 'lucproblem005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem005-c', 'lucproblem005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <conio.h>
+int main()
+{
+ int working_hour, i = 1;
+ double pay;
+ while (i <= 10)
+ {
+ printf("Enter the working hour for the employee no. %d : ", i);
+ if (scanf("%d", &working_hour) != 1)
+ {
+ printf("\n\tPlease enter a number as woking hour.\n\n");
+ while (getchar() != '\n')
+ ;
+ // above line discard the input characters untill getchar() reaches the new line character.
+ /* if I do not discard the input, after 'continue;' 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 > 40)
+ {
+ pay = (working_hour - 40) * 120.00;
+ printf("\n\tOvertime working hours of Employee %d : %d", i, (working_hour - 40));
+ printf("\n\tPay of the overtime for Employee %d : Rs. %.2f\n\n", i, pay);
+ }
+ else
+ printf("\n\tEmployee %d did not work any overtime.\n\n", 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('lucproblem006.c', 'lucproblem006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem006-c', 'lucproblem006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int num, i = 1;
+ long long fact = 1;
+ printf("Enter the number : ");
+ // checking if the input is valid or not
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ return 1;
+ }
+ // result for the negetive input
+ if (num < 0)
+ {
+ printf("\nFactorial of %d : Undefined", num);
+ return 1;
+ }
+ // Hard codded result for input '0' (zero)
+ if (num == 0)
+ {
+ printf("\nFactorial of 0 : 1");
+ return 0;
+ }
+ // calculating result
+ while (i <= num) {
+ fact = fact * i;
+ i++;
+ }
+ printf("\nFactorial of %d : %d", 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('lucproblem007.c', 'lucproblem007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem007-c', 'lucproblem007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double num, result;
+ int power, i = 1;
+ printf("Enter the numbers in 'num^power' format : ");
+ // checking if the input is valid or not
+ if (scanf("%lf^%d", &num, &power) != 2)
+ {
+ printf("\nPlease enter numbers.");
+ return 1;
+ }
+ // result for the negetive input
+ if (power < 0)
+ {
+ printf("\nPlease use a positive number as power.");
+ return 1;
+ }
+ // Hard codded result for input '0' (zero)
+ if (power == 0)
+ {
+ printf("\n%g to the power of %d is : 1", num, power);
+ return 0;
+ }
+ result = num;
+ while (i <= power - 1)
+ {
+ result = result * num;
+ i++;
+ }
+ printf("\n%g to the power of %d is : %g", 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('lucproblem008.c', 'lucproblem008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem008-c', 'lucproblem008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#include <stdbool.h>
+
+#define LIMIT 300
+
+int main()
+{
+ printf("Prime numbers from 1 to 300 : 2"); // as 2 is the only even prime number
+ for (int i = 3; i <= LIMIT; i += 2) // skipping all other even number
+ {
+ int n = (int)sqrt(i);
+ bool prime = true;
+
+ for (int j = 3; j <= 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(" %d", 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('lucproblem009.c', 'lucproblem009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem009-c', 'lucproblem009.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#define N 7 // update N here
+
+int main()
+{
+ double sum = 0; int fact = 1;
+ for (int i = 1; i <= N; i++)
+ {
+ fact *= i;
+ sum += (double)i / fact;
+ }
+ printf("Sum of the series : %g", 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('lucproblem010-complex.c', 'lucproblem010-complex.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem010-complex.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem010-complex-c', 'lucproblem010-complex.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem010-complex-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+// --- 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(" %d", 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 <= 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("Combination of 1, 2 and 3 (1-digit up to 4-digits):\n");
+
+ /* 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 <= 4; noOfDigits++)
+ {
+ printf("\n\n--- %d-DIGIT NUMBERS (%d total) ---\n", noOfDigits, (1 << 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("\n\nTotal permutations generated: 120\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('lucproblem010.c', 'lucproblem010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem010-c', 'lucproblem010.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ printf("Combination of 1, 2 and 3 :");
+
+ // for 1 digit numbers
+ for (int i = 1; i <= 3; i++)
+ {
+ printf(" %d", i);
+ }
+
+ // for 2 digit numbers
+ for (int i = 1; i <= 3; i++)
+ {
+ for (int j = 1; j <= 3; j++)
+ {
+ printf(" %d%d", i, j);
+ }
+ }
+
+ // for 3 digit numbers
+ for (int i = 1; i <= 3; i++)
+ {
+ for (int j = 1; j <= 3; j++)
+ {
+ for (int k = 1; k <= 3; k++)
+ {
+ printf(" %d%d%d", i, j, k);
+ }
+ }
+ }
+
+ // for 4 digit numbers
+ for (int i = 1; i <= 3; i++)
+ {
+ for (int j = 1; j <= 3; j++)
+ {
+ for (int k = 1; k <= 3; k++)
+ {
+ for (int l = 1; l <= 3; l++)
+ {
+ printf(" %d%d%d%d", 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('lucproblem011.c', 'lucproblem011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem011-c', 'lucproblem011.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 'Exit' option the program should continue work.
+*/
+/* Author - Amit Dutta, Date - 26th OCT, 2025 */
+/* Let Us C, Chap - 7, Page - 118, Problem 7.1 */
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+// Function to clear the input buffer after scanf to prevent issues in the next input.
+void clearInputBuffer()
+{
+ int c;
+ while ((c = getchar()) != '\n' && c != EOF)
+ ;
+}
+
+// Calculates the factorial of the input number.
+void factorial(int num)
+{
+ // Factorial is not defined for negative numbers.
+ if (num < 0)
+ {
+ printf("\nFactorial is not defined for negative numbers.");
+ return;
+ }
+ // Checks for input over 20 to prevent long long integer overflow (20! is max safe).
+ if (num > 20)
+ {
+ printf("\nFactorial of %d is too large to calculate (max safe integer factorial is 20!).", num);
+ return;
+ }
+ long long fact = 1;
+ // Calculate factorial iteratively.
+ for (int i = 1; i <= num; i++)
+ {
+ fact *= i;
+ }
+ printf("\nFactorial of %d = %lld", 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("\nInput 1 is NOT a PRIME NUMBER.");
+ return;
+ }
+ else if (num == 2)
+ {
+ printf("\nInput 2 is a PRIME NUMBER. (Fact : 2 is only even prime number)");
+ return;
+ }
+ // Exclude all other even numbers.
+ if (num % 2 == 0)
+ {
+ printf("\nInput %d is NOT a PRIME NUMBER.", 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 <= endCheckDigit; i += 2)
+ {
+ if (num % i == 0)
+ {
+ printf("\nInput %d is NOT a PRIME NUMBER.", num);
+ isPrime = false;
+ break;
+ }
+ }
+ if (isPrime)
+ {
+ printf("\nInput %d is a PRIME NUMBER.", 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("\nInput %d is a EVEN NUMBER.", num);
+ return;
+ }
+ else
+ {
+ printf("\nInput %d is a ODD NUMBER.", 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 'Exit' is chosen.
+ while (1)
+ {
+ // Display menu options.
+ printf("\n\n===== MENU ====="
+ "\n1. Factorial of a number"
+ "\n2. Prime or not"
+ "\n3. Odd or Even"
+ "\n4. Exit");
+ printf("\nEnter your choice : ");
+
+ // Input validation for menu choice.
+ if (scanf("%d", &choice) != 1)
+ {
+ printf("\nPlease enter a number.");
+ clearInputBuffer();
+ continue;
+ }
+ clearInputBuffer();
+
+ // Handle menu selection using switch-case.
+ switch (choice)
+ {
+ case 1:
+ printf("\n=== FACTORIAL OF A NUMBER ===");
+ printf("\nEnter the number : ");
+ // Input validation for the number to be factored.
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ clearInputBuffer();
+ continue;
+ }
+ clearInputBuffer();
+ factorial(num);
+ break;
+ case 2:
+ printf("\n=== PRIME OR NOT ===");
+ printf("\nEnter the number : ");
+ // Input validation for the number to be checked.
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ clearInputBuffer();
+ continue;
+ }
+ clearInputBuffer();
+ // Require a non-negative, non-zero number for prime check.
+ if (num < 0)
+ {
+ printf("\nPlease enter a postive number.");
+ continue;
+ }
+ else if (num == 0)
+ {
+ printf("\nPlease enter a non-zero number.");
+ continue;
+ }
+ prime(num);
+ break;
+ case 3:
+ printf("\n=== ODD OR EVEN ===");
+ printf("\nEnter the number : ");
+ // Input validation for the number to be checked.
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ clearInputBuffer();
+ continue;
+ }
+ clearInputBuffer();
+ oddoreven(num);
+ break;
+ case 4:
+ // Exit the program cleanly.
+ printf("\nExiting the program.\n\nSAYONARA...\n\n");
+ exit(0);
+ default:
+ // Handle invalid menu choice input.
+ printf("\nPlease enter a valid choice.");
+ 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('lucproblem012.c', 'lucproblem012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem012-c', 'lucproblem012.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+double power(double, int);
+
+double power(double a, int b)
+{
+ if (b == 0)
+ return 1;
+ double res = 1;
+ int i;
+ if (b > 0)
+ for (i = 1; i <= b; i++)
+ res *= a;
+ return res;
+}
+
+int main()
+{
+ double a, result;
+ int b;
+ printf("Enter the value and the power (Format A^B) : ");
+ scanf("%lf^%d", &a, &b);
+ result = power(a, b);
+ printf("Result of %g^%d = %g", 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('lucproblem013.c', 'lucproblem013.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem013.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem013-c', 'lucproblem013.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem013-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+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[] = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
+ // including the two-character subtractive pairs.
+ int i = 0;
+
+ printf("Year %d = ", year);
+ while (year > 0)
+ {
+ if (year >= values[i])
+ {
+ printf("%s", romanChar[i]);
+ year -= values[i];
+ }
+ else
+ i++;
+ }
+}
+
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &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('lucproblem014-short.c', 'lucproblem014-short.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem014-short.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem014-short-c', 'lucproblem014-short.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem014-short-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+void stats(double *, double *, double *);
+
+int main()
+{
+ double sum, average, standardDeviation;
+ stats(&sum, &average, &standardDeviation);
+
+ printf("\n--- Stats ---"
+ "\nSum: %g"
+ "\nAverage: %g"
+ "\nStandard Deviation: %g",
+ sum, average, standardDeviation);
+ return 0;
+}
+
+void stats(double *sum, double *average, double *standardDeviation)
+{
+ int n;
+ printf("How many numbers you want to give input: ");
+ scanf("%d", &n);
+
+ double inputNumber[n];
+ int i;
+
+ printf("\n--- Enter Numbers ---\n");
+ for (i = 0; i < n; i++)
+ {
+ printf("Enter number %d: ", i + 1);
+ scanf("%lf", &inputNumber[i]);
+ }
+
+ double tempSum = 0;
+ for (i = 0; i < n; i++)
+ tempSum += inputNumber[i];
+
+ double tempAverage = tempSum / n;
+
+ double tempStandardDeviation = 0.0;
+
+ if (n > 1)
+ {
+ double tempSumation = 0;
+ for (i = 0; i < 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('lucproblem014.c', 'lucproblem014.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem014.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem014-c', 'lucproblem014.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem014-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+// Function prototype: Using pointers for 'call by reference' 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(&sum, &average, &standardDeviation);
+
+ printf("\n--- Stats ---"
+ "\nSum: %g"
+ "\nAverage: %g"
+ "\nStandard Deviation: %g",
+ 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("How many numbers you want to give input: ");
+
+ if (scanf("%d", &n) == 1)
+ {
+ break;
+ }
+ else
+ {
+ printf("\nPlease enter a valid number.\n");
+ // Clearing input buffer to handle invalid input
+ while (getchar() != '\n' && !feof(stdin))
+ ;
+ }
+ } while (1);
+
+ // Variable-Length Array (VLA) to store the input numbers.
+ double inputNumber[n];
+ int i = 0;
+
+ printf("\n--- Enter Numbers ---\n");
+
+ // Input Loop for numbers
+ while (i < n)
+ {
+ printf("Enter number %d: ", i + 1);
+
+ if (scanf("%lf", &inputNumber[i]) == 1)
+ {
+ // Clearing input buffer after successful read
+ while (getchar() != '\n')
+ ;
+ i++;
+ }
+ else
+ {
+ printf("Invalid input. Only integers are allowed. Please try again.\n");
+ // Clearing input buffer to handle invalid input
+ while (getchar() != '\n' && !feof(stdin))
+ ;
+ }
+ }
+
+ // 1. Sum Calculation
+ double tempSum = 0;
+ for (i = 0; i < 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 > 1)
+ {
+ double tempSumation = 0;
+ // calculating the sum of squared differences from the mean
+ for (i = 0; i < 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('lucproblem015.c', 'lucproblem015.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem015.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem015-c', 'lucproblem015.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem015-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void bothPowerFactorial(double, int, int, double *, long long *);
+
+int main()
+{
+ double a, resultPower;
+ int b, factN;
+ long long resultFactorial;
+ printf("Enter a and b for calculating a raised to b: ");
+ scanf("%lf %d", &a, &b);
+ printf("Enter number to calculate the factorial: ");
+ scanf("%d", &factN);
+ if (b < 0 || factN < 0)
+ {
+ printf("\nOnly non-negative integer is allowed as input of b and factorial.");
+ return 1;
+ }
+ bothPowerFactorial(a, b, factN, &resultPower, &resultFactorial);
+ printf("\n%g Raised to %d: %g"
+ "\nFactorial of %d: %lld",
+ 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 <= b; i++)
+ tempResultPower *= a;
+
+ for (i = 1; i <= 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('lucproblem016.c', 'lucproblem016.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/letusc/lucproblem016.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-letusc-lucproblem016-c', 'lucproblem016.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-letusc-lucproblem016-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ float a = 3.14;
+ float *c = &a;
+ float **b = &c;
+
+ printf("Location 1 (Variable a):\n");
+ printf("Value: %g\n", a);
+ printf("Address: %p\n", (void *)&a);
+ printf("------------------------------\n");
+
+ printf("Location 3 (Variable c: float *):\n");
+ printf("Value (Address stored): %p\n", (void *)c);
+ printf("Address of c itself: %p\n", (void *)&c);
+ printf("Value pointed to (*c): %g\n", *c);
+ printf("------------------------------\n");
+
+ printf("Location 2 (Variable b: float **):\n");
+ printf("Value (Address stored): %p\n", (void *)b);
+ printf("Address of b itself: %p\n", (void *)&b);
+ printf("Value pointed to (*b): %p\n", (void *)*b);
+ printf("Value pointed to (**b): %g\n", **b);
+ printf("------------------------------\n");
+
+ return 0;
+}</div>
</div>
</div>
@@ -1626,171 +9337,987 @@
<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('pc001.c', 'pc001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc001-c', 'pc001.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc001.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc001.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ 1
+ 1 2
+ 1 2 3
+ 1 2 3 4
+ 1 2 3 4 5
+for n = 5
+*/
+/* Author - Amit Dutta, Date - 02nd October, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, num;
+ printf("Enter n : ");
+ scanf("%d", &num);
+ for (i = 1; i <= num; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", j);
+ }
+ printf("\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('pc002.c', 'pc002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc002-c', 'pc002.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc002.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc002.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ 1 2 3 4 5
+ 6 7 8 9
+ 10 11 12
+ 13 14
+ 15
+for n = 5
+*/
+
+/* Author - Amit Dutta, Date - 02nd NOVEMBER, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n, temp = 1;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\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('pc003.c', 'pc003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc003-c', 'pc003.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc003.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc003.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ 1
+ 2 4
+ 3 6 9
+ 4 8 12 16
+ 5 10 15 20 25
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", i * j);
+ }
+ printf("\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('pc004.c', 'pc004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc004-c', 'pc004.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc004.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc004.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ 5 4 3 2 1
+ 4 3 2 1
+ 3 2 1
+ 2 1
+ 1
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, k, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = 1; j <= i - 1; j++)
+ {
+ printf("\t");
+ }
+ for (k = i; k >= 1; k--)
+ {
+ printf("%d\t", k);
+ }
+ printf("\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('pc005.c', 'pc005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc005-c', 'pc005.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc005.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc005.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ 1
+ 1 2
+ 3 5 8
+ 13 21 34 55
+ 89 144 233 377 610
+for n = 5
+*/
+
+#include <stdio.h>
+int main()
+{
+ int i, j, n;
+ long long temp1 = 0, temp2 = 1, temp3;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ printf("1\n");
+ for (i = 2; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ temp3 = temp1 + temp2;
+ printf("%lld\t", temp3);
+ temp1 = temp2;
+ temp2 = temp3;
+ }
+ printf("\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('pc006.c', 'pc006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc006-c', 'pc006.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc006.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc006.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Prime number check */
+/* Author - Amit Dutta, Date - 03rd NOVEMBER, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num, i, temp;
+ printf("Enter the number : ");
+ if(scanf("%d", &num) != 1) {
+ printf("Only postive number allowed.");
+ return 1;
+ }
+ if(num <= 0) {
+ printf("\nOnly potive number are allowed.");
+ return 1;
+ }
+ if(num == 1) {
+ printf("\nInput 1 is not a prime number.");
+ return 0;
+ }
+ if(num == 2) {
+ printf("\nInput 2 is a prime number.");
+ return 0;
+ }
+ if(num % 2 == 0) {
+ printf("\nInput %d is not a prime number.", num);
+ return 0;
+ }
+ temp = (int)sqrt(num);
+ for (i = 3; i <= temp; i += 2)
+ {
+ if (num % i == 0)
+ {
+ printf("\nInput %d is not a prime number.", num);
+ return 0;
+ }
+ }
+ printf("\nInput %d is a prime number.", 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('pc007.c', 'pc007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc007-c', 'pc007.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc007.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc007.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Armstrong number check only for three digit */
+/* Author - Amit Dutta, Date - 03rd NOVEMBER, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int num, temp1, armstrongCheck = 0;
+ printf("Enter a three digit number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nOnly positive number allowed.");
+ return 1;
+ }
+ if (num < 100 || num > 999)
+ {
+ printf("\nOnly Three digit postive number allowed.");
+ return 1;
+ }
+ temp1 = num;
+ while (temp1 > 0)
+ {
+ armstrongCheck += (temp1 % 10) * (temp1 % 10) * (temp1 % 10);
+ temp1 /= 10;
+ }
+ if (armstrongCheck == num)
+ printf("\nInput %d is a armstrong number.", num);
+ else
+ printf("\nInput %d is not a armstrong number.", 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('pc008.c', 'pc008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc008-c', 'pc008.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc008.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc008.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Factorial upto N */
+/* Author - Amit Dutta, Date - 03rd November, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int n, i;
+ long long fact = 1;
+ printf("Enter n : ");
+ if (scanf("%d", &n) != 1)
+ {
+ printf("\nOnly non-negative number allowed.");
+ return 1;
+ }
+ if (n < 0)
+ {
+ printf("\nOnly non-negative number allowed.");
+ return 1;
+ }
+ if (n == 0)
+ {
+ printf("\nFactorial of 0 : 1");
+ return 0;
+ }
+ for (i = 1; i <= n; i++)
+ fact *= i;
+ printf("\nFactorial of %d : %lld", n, 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('pc009.c', 'pc009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc009-c', 'pc009.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc009.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc009.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Sum of digit */
+/* Author - Amit Dutta, Date - 04th November, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int num, sumOfDigit = 0, temp;
+ printf("Enter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nOnly a number is allowed.");
+ return 1;
+ }
+ temp = num;
+ while (temp > 0)
+ {
+ sumOfDigit += temp % 10;
+ temp /= 10;
+ }
+ printf("\nSum of the digit %d : %d", num, sumOfDigit);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('pc010.c', 'pc010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc010-c', 'pc010.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc010.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc010.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Reverse a number */
+/* Author - Amit Dutta, Date - 04th November, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int num, temp, rev = 0;
+ printf("\nEnter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nOnly a number is allowed.");
+ return 1;
+ }
+ temp = num;
+ while (temp > 0)
+ {
+ rev = (rev * 10) + (temp % 10);
+ temp /= 10;
+ }
+ printf("\nReverse of the number %d : %d", num, rev);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('pc011.c', 'pc011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc011-c', 'pc011.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc011.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc011.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a C program that takes two positive integers, L (Lower Bound)
+and U (Upper Bound), as input from the user. The program must find and print
+the count of all numbers between L and U (inclusive) that
+are also a Palindrome Number. */
+/* Author - Amit Dutta, Date - 11th November, 2025 */
+
+#include <stdio.h>
+#define true 1
+#define false 0
+
+int isPalindrome(int num)
+{
+ int temp = num, numRev = 0;
+ while (temp > 0)
+ {
+ numRev = (numRev * 10) + (temp % 10);
+ temp /= 10;
+ }
+ if (num == numRev)
+ return true;
+ else
+ return false;
+}
+
+int main()
+{
+ int uBound, lBound, num, palindromeCount = 0;
+ printf("Enter the Lower Bound and Upper Bound : ");
+ if (scanf("%d %d", &lBound, &uBound) != 2)
+ {
+ printf("\nOnly Integer values are allowed.");
+ return 1;
+ }
+ if (lBound < 0 || uBound < 0 || lBound > uBound)
+ {
+ printf("\nPlease enter appropriate inforamtion.");
+ return 1;
+ }
+ printf("Palindrome Numbers from %d to %d :", lBound, uBound);
+ for (num = lBound; num <= uBound; num++)
+ {
+ if (isPalindrome(num))
+ {
+ printf(" %d", num);
+ palindromeCount++;
+ }
+ }
+ printf("\nTotal Palindrome number found inside the range (%d to %d) : %d", lBound, uBound, palindromeCount);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('pc012.c', 'pc012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/practice-c/pc012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-practice-c-pc012-c', 'pc012.c', 'https://github.com/notamitgamer/bsc/blob/main/practice-c/pc012.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc012.c</span>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
- <a href="https:/github.com/notamitgamer/bsc/blob/main/practice-c/pc012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/practice-c/pc012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
</a>
</div>
+ <!-- Embedded Code Storage -->
+ <div id="code-practice-c-pc012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a C function that receives a string (character array) and uses
+pointers to count and return the total number of vowels and consonants in that string. */
+/* Author: Amit Dutta, Date: 02-12-2025 */
+
+#include <stdio.h>
+#include <ctype.h>
+
+void charCounter(char[], int *, int *);
+
+int main()
+{
+ char str[101];
+ int vowelCount, consonantCount;
+ printf("Enter the string (Max: 100 character): ");
+ if (fgets(str, sizeof(str), stdin) == NULL)
+ {
+ printf("Error reading input.\n");
+ return 1;
+ }
+ charCounter(str, &vowelCount, &consonantCount);
+ printf("\nVowel Count: %d", vowelCount);
+ printf("\nConsonant Count: %d", consonantCount);
+ printf("\nTotal Character: %d", vowelCount + consonantCount);
+ return 0;
+}
+
+void charCounter(char str[], int *vowelCount, int *consonantCount)
+{
+ int tempVowelCount = 0, tempConsonantCount = 0;
+ while (*str != '\0')
+ {
+ char ch = tolower(*str);
+ if (isalpha(ch))
+ {
+ if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
+ {
+ tempVowelCount++;
+ }
+ else
+ {
+ tempConsonantCount++;
+ }
+ }
+ str++;
+ }
+
+ *vowelCount = tempVowelCount;
+ *consonantCount = tempConsonantCount;
+}</div>
</div>
</div>
@@ -1809,1725 +10336,9720 @@
<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('APC-PRAC-001.c', 'APC-PRAC-001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-001-c', 'APC-PRAC-001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate area and perimeter of a rectangle
+by accepting length and breadth as input. */
+// Author - Amit Dutta, Date - 18th SEP, 2025
+
+#include<stdio.h>
+int main() {
+ double length, breadth, area, perimeter;
+ printf("Enter the length and breadth of the Rectangle : ");
+ scanf("%lf %lf", &length, &breadth);
+ area = length * breadth;
+ perimeter = 2 * (length + breadth);
+ printf("\nArea of the Rectangle : %g"
+ "\nPerimeter of the Rectangle : %g", 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('APC-PRAC-002.c', 'APC-PRAC-002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-002-c', 'APC-PRAC-002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double r, area;
+ printf("Enter the radius of the circle : ");
+ scanf("%lf", &r);
+ area = M_PI * pow(r, 2);
+ printf("\nArea of the circle : %g", 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('APC-PRAC-003.c', 'APC-PRAC-003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-003-c', 'APC-PRAC-003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to accept diagonal of a square and calculate area, parimeter */
+/* Author - Amit Dutta, Date - 18th SEP, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+int main()
+{
+ double dia, side, area, peri;
+ printf("Enter the diagonal of the square : ");
+ scanf("%lf", &dia);
+ side = dia / sqrt(2);
+ area = pow(side, 2);
+ peri = 4 * side;
+ printf("\nArea of the square : %g"
+ "\nPerimeter of the square : %g",
+ 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('APC-PRAC-004.c', 'APC-PRAC-004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-004-c', 'APC-PRAC-004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate and display radius of a circle by taking the area as input. */
+/* Author - Amit Dutta, Date - 18th SEP, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+int main()
+{
+ double r, area;
+ printf("Enter the area of the circle : ");
+ scanf("%lf", &area);
+ r = sqrt(area / M_PI);
+ printf("\nRadius of the circle : %g", 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('APC-PRAC-005.c', 'APC-PRAC-005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-005-c', 'APC-PRAC-005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int days, months, years, temp;
+ printf("Enter the No. of days : ");
+ scanf("%d", &days);
+ temp = days;
+ years = days / 365;
+ days = days % 365;
+ months = days / 30;
+ days = days % 30;
+ printf("%d Days = %d Years, %d Months, %d Days", 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('APC-PRAC-006.c', 'APC-PRAC-006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-006-c', 'APC-PRAC-006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP that accept seconds as input and represent it an hours, minutes and seconds. */
+/* Author - Amit Dutta, Date - 19th SEP, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int sec, hours, minutes, temp;
+ printf("Enter the no of seconds : ");
+ scanf("%d", &sec);
+ temp = sec;
+ hours = sec / 3600;
+ sec = sec % 3600;
+ minutes = sec / 60;
+ sec = sec % 60;
+ printf("\n%d Seconds = %d Hours, %d Minutes, %d Seconds.", 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('APC-PRAC-007.c', 'APC-PRAC-007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-007-c', 'APC-PRAC-007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double bs, gs, ns, da, hra, pf;
+ printf("Enter the basic salary of the employee : ");
+ scanf("%lf", &bs);
+ da = bs * 0.25;
+ hra = bs * 0.125;
+ pf = bs * 0.10;
+ gs = bs + da + hra;
+ ns = gs - pf;
+ printf("\nGross Salary : %g"
+ "\nNet Salary : %g",
+ 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('APC-PRAC-008.c', 'APC-PRAC-008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-008-c', 'APC-PRAC-008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to multiply and divide a number by 4 without
+using multiplication and division operator. */
+/* Author - Amit Dutta, Date - 19th SEP, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int num, multi, div;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ multi = num << 2;
+ div = num >> 2;
+ printf("Multiplication : %d"
+ "\nDivision : %d",
+ 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('APC-PRAC-009.c', 'APC-PRAC-009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-009-c', 'APC-PRAC-009.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to swap two integer variable without using Third variable. */
+/* Author - Amit Dutta, Date - 19th SEP, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int a = 4, b = 6;
+ printf("Before swap : A = %d and B = %d", a, b);
+ a = a ^ b;
+ b = a ^ b;
+ a = a ^ b;
+ printf("\nAfter swap : A = %d and B = %d", 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('APC-PRAC-010.c', 'APC-PRAC-010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-010-c', 'APC-PRAC-010.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ double a, b, c, result;
+ printf("Enter the value for a, b and c : ");
+ scanf("%lf %lf %lf", &a, &b, &c);
+ result = (1 / pow(a, 3)) + (1 / pow((b + 2), 3)) + (1 / (pow(c, 4) + sqrt(2)));
+ printf("\nResult = %g", 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('APC-PRAC-011.c', 'APC-PRAC-011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-011-c', 'APC-PRAC-011.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to input positive number and check whether the number is
+perfect square or not. If the number is negetive then display appropriate message */
+/* Author - Amit Dutta, Date - 31st October, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num, temp;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ if (num < 0)
+ {
+ printf("\nYou entered a negetive number.");
+ return 1;
+ }
+ temp = (int)sqrt(num);
+ if (temp * temp == num)
+ {
+ printf("\nInput %d is a perfect square number.", num);
+ return 0;
+ }
+ else
+ printf("\nInput %d is not a perfect square number.", num);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-012.c', 'APC-PRAC-012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-012-c', 'APC-PRAC-012.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to input three integer and find out second largest */
+/* Author - Amit Dutta, Date - 31st October, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int a, b, c, secondLargest;
+ printf("Enter three number : ");
+ scanf("%d %d %d", &a, &b, &c);
+ if ((a < b && a > c) || (a > b && a < c))
+ secondLargest = a;
+ if ((b < a && b > c) || (b > a && b < c))
+ secondLargest = b;
+ if ((c < b && c > a) || (c > b && c < a))
+ secondLargest = c;
+ printf("\nSecond Largest : %d", secondLargest);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-013.c', 'APC-PRAC-013.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-013.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-013-c', 'APC-PRAC-013.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-013-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to input sum(p), rate of interest(r), time(t) and type of interest
+('s' for simple interes, 'c' for compound interest), then calculate and display the earned interest */
+/* Author - Amit Dutta, Date - 31st October, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+
+int main()
+{
+ double p, t, r, si, ci;
+ char mode;
+ printf("Enter the Principle, Time (Year) and the Rate of Interest : ");
+ scanf("%lf %lf %lf", &p, &t, &r);
+ printf("Enter the mode of calculation ('s' for simple interest, 'c' for compound interest) : ");
+ scanf(" %c", &mode);
+ mode = tolower(mode);
+ switch (mode)
+ {
+ case 's':
+ si = (p * t * r) / 100;
+ printf("\nSimple Interest : %g", si);
+ return 0;
+ case 'c':
+ ci = (p * pow(1 + (r / 100), t)) - p;
+ printf("\nCompound Interest : %g", ci);
+ return 0;
+ default:
+ printf("\nYou entered a wrong choice.");
+ return 1;
+ }
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-014.c', 'APC-PRAC-014.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-014.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-014-c', 'APC-PRAC-014.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-014-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to calculate and display the maturity amount taking
+the sum and number of days as input.
+ No. of Days Rate of Interest
+ =========== ================
+ <= 180 5.57 %
+ 181 - 364 7.75 %
+ 365 - 500 9.25 %
+ > 500 9.15 %
+*/
+/* Author - Amit Dutta, Date - 31st October, 2025 */
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+
+int main()
+{
+ double p, t, r, si;
+ int days;
+ printf("Enter the Principle, Time (Days) : ");
+ scanf("%lf %d", &p, &days);
+ if (days > 0 && days <= 180)
+ r = 5.57;
+ else if (days > 180 && days <= 364)
+ r = 7.75;
+ else if (days > 364 && days <= 500)
+ r = 9.25;
+ else if (days > 500)
+ r = 9.15;
+ si = (p * t * r) / 100;
+ printf("\nMaturity Amount : %d", si + p);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-015.c', 'APC-PRAC-015.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-015.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-015-c', 'APC-PRAC-015.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-015-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int lb, ub, i;
+ printf("Enter the lb, ub : ");
+ scanf("%d %d", &lb, &ub);
+ printf("\nEnds with 7 :");
+ for (i = lb; i <= ub; i++)
+ {
+ if (i % 10 == 7)
+ {
+ printf(" %d", i);
+ }
+ }
+ printf("\nDivisible by 7 :");
+ for (i = lb; i <= ub; i++)
+ {
+ if (i % 7 == 0)
+ {
+ printf(" %d", 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('APC-PRAC-016.c', 'APC-PRAC-016.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-016.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-016-c', 'APC-PRAC-016.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-016-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int num, temp, rev = 0;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ temp = num;
+ while (temp > 0)
+ {
+ rev = (rev * 10) + (temp % 10);
+ temp /= 10;
+ }
+ if (rev == num)
+ printf("\nInput %d is a palindrome number.", num);
+ else
+ printf("\nInput %d is not a palindrome number.", 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('APC-PRAC-017.c', 'APC-PRAC-017.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-017.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-017-c', 'APC-PRAC-017.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-017-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int num, i, divisibleSum = 0;
+ printf("Enter a number : ");
+ scanf("%d", &num);
+ for (i = 1; i <= num / 2; i++)
+ {
+ if (num % i == 0)
+ {
+ divisibleSum += i;
+ }
+ }
+ if (divisibleSum == num)
+ printf("\nInput %d ia a Perfect Number.", num);
+ else
+ printf("\nInput %d is NOT a Perfect Number.", 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('APC-PRAC-018.c', 'APC-PRAC-018.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-018.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-018-c', 'APC-PRAC-018.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-018-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num, square, count = 0, temp, modNum;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ square = (int)pow(num, 2);
+ temp = num;
+ while (temp > 0)
+ {
+ temp /= 10;
+ count++;
+ }
+ modNum = (int)pow(10, count);
+ temp = square % modNum;
+ if (num == temp)
+ printf("\nInput %d is a Automorphic Number.", num);
+ else
+ printf("\nInput %d is a Automorphic Number.", 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('APC-PRAC-019.c', 'APC-PRAC-019.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-019.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-019-c', 'APC-PRAC-019.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-019-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to find hcf of two numbers */
+/* Author - Amit Dutta, Date - 07th November, 2025 */
+// File Name - amit0711202501.c (LAB), APC-PRAC-019.c (Local)
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+
+int main()
+{
+ int a, b, temp, temp_a, temp_b;
+ printf("Enter the a and b : ");
+ scanf("%d %d", &a, &b);
+ temp_a = a, temp_b = b;
+ while (b > 0)
+ {
+ temp = a;
+ a = b;
+ b = temp % b;
+ }
+ printf("\nHCF of %d and %d is : %d\n", temp_a, temp_b, a);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-020.c', 'APC-PRAC-020.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-020.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-020-c', 'APC-PRAC-020.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-020-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to check if two number is co-prime or not */
+/* Author - Amit Dutta, Date - 07th November, 2025 */
+// File Name - amit0711202502.c (LAB), APC-PRAC-020.c (Local)
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+
+int main()
+{
+ int a, b, temp, temp_a, temp_b;
+ printf("Enter the a and b : ");
+ scanf("%d %d", &a, &b);
+ temp_a = a, temp_b = b;
+ while (b > 0)
+ {
+ temp = a;
+ a = b;
+ b = temp % b;
+ }
+ if (a == 1)
+ printf("\n%d and %d is co-prime\n", temp_a, temp_b);
+ else
+ printf("\n%d and %d is NOT co-prime\n", temp_a, temp_b);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-021.c', 'APC-PRAC-021.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-021.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-021-c', 'APC-PRAC-021.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-021-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to check special number (sum of digit + product of digit = original number) */
+/* Author - Amit Dutta, Date - 07th November, 2025 */
+// File Name - amit0711202503.c (LAB), APC-PRAC-021.c (Local)
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+
+int main()
+{
+ int num, temp, sumOfDigit = 0, productOfDigit = 1;
+ printf("Enter the number to check if it is a special number : ");
+ scanf("%d", &num);
+ temp = num;
+ while (temp > 0)
+ {
+ sumOfDigit += temp % 10;
+ productOfDigit *= temp % 10;
+ temp /= 10;
+ }
+ temp = sumOfDigit + productOfDigit;
+ if (num == temp)
+ printf("\nInput %d is a special number.", num);
+ else
+ printf("\nInput %d is not a special number.", num);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-022.c', 'APC-PRAC-022.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-022.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-022-c', 'APC-PRAC-022.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-022-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to accept a number and check whether the number is twisted prime or not */
+/* Author - Amit Dutta, Date - 07th November, 2025 */
+// File Name - amit0711202504.c (LAB), APC-PRAC-022.c (Local)
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+#include <math.h>
+#include <stdbool.h>
+
+bool checkPrime(int num)
+{
+ if (num < 2)
+ return false;
+ if (num == 2)
+ return true;
+ if (num % 2 == 0)
+ return false;
+ int limit = (int)sqrt(num);
+ for (int i = 3; i <= limit; i += 2)
+ if (num % i == 0)
+ return false;
+ return true;
+}
+
+int reverseNumber(int num)
+{
+ int reverse = 0;
+ while (num > 0)
+ {
+ reverse = (reverse * 10) + (num % 10);
+ num /= 10;
+ }
+ return reverse;
+}
+
+int main()
+{
+ int num;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ if (!checkPrime(num))
+ {
+ printf("\nInput %d is not a prime number.", num);
+ return 0;
+ }
+ if (checkPrime(reverseNumber(num)))
+ printf("\nInput %d is a twisted prime number.", num);
+ else
+ printf("\nInput %d is not a twisted prime number.", num);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-023.c', 'APC-PRAC-023.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-023.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-023-c', 'APC-PRAC-023.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-023-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Pattern :
+ (a) 1, -3, 5, -7, 9, -11, ... upto n times
+ (b) 0, 3, 8, 15, ... upto n times
+*/
+/* Author - Amit Dutta, Date - 07th November, 2025 */
+// File Name - amit0711202505.c (LAB), APC-PRAC-023.c (Local)
+
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+// Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
+
+#include <stdio.h>
+#include <stdbool.h>
+
+int main()
+{
+ int n, i, temp = 1;
+ bool isNegative = true;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ printf("\nPattern A :");
+ for (i = 1; i <= n; i++)
+ {
+ if (!isNegative)
+ {
+ printf(" %d", temp * -1);
+ isNegative = true;
+ }
+ else
+ {
+ printf(" %d", temp);
+ isNegative = false;
+ }
+ temp += 2;
+ }
+ printf("\nPattern B :");
+ for (i = 1; i <= n; i++)
+ {
+ temp = (i * i) - 1;
+ printf(" %d", temp);
+ }
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-PRAC-024.c', 'APC-PRAC-024.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-024.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-024-c', 'APC-PRAC-024.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-024-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = i; j >= 1; j--) {
+ printf("%d ", j);
+ }
+ printf("\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('APC-PRAC-025.c', 'APC-PRAC-025.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-025.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-025-c', 'APC-PRAC-025.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-025-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = n; j >= i; j--) {
+ printf("%d ", j);
+ }
+ printf("\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('APC-PRAC-026.c', 'APC-PRAC-026.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-026.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-026-c', 'APC-PRAC-026.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-026-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = n; i >= 1; i--) {
+ for(j = n; j >= i; j--) {
+ printf("%d ", j);
+ }
+ printf("\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('APC-PRAC-027.c', 'APC-PRAC-027.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-027.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-027-c', 'APC-PRAC-027.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-027-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = i; j <= n; j++) {
+ printf("%d ", j);
+ }
+ printf("\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('APC-PRAC-028.c', 'APC-PRAC-028.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-028.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-028-c', 'APC-PRAC-028.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-028-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j, temp = 1;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = 1; j <= i; j++) {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\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('APC-PRAC-029.c', 'APC-PRAC-029.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-029.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-029-c', 'APC-PRAC-029.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-029-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = 1; j <= i; j++) {
+ if(j % 2 == 0) printf("0 ");
+ else printf("1 ");
+ }
+ printf("\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('APC-PRAC-030.c', 'APC-PRAC-030.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-030.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-030-c', 'APC-PRAC-030.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-030-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = 1; j <= i; j++) {
+ if(i % 2 == 0) printf("@ ");
+ else printf("# ");
+ }
+ printf("\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('APC-PRAC-031.c', 'APC-PRAC-031.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-031.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-031-c', 'APC-PRAC-031.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-031-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j, temp = 1;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = n; i >= 1; i--) {
+ for(j = 1; j <= i; j++) {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\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('APC-PRAC-032.c', 'APC-PRAC-032.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-032.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-032-c', 'APC-PRAC-032.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-032-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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<stdio.h>
+int main() {
+ int n, i, j; char temp = 'A';
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for(i = 1; i <= n; i++) {
+ for(j = 1; j <= i; j++) {
+ printf("%c\t", temp);
+ }
+ temp++;
+ printf("\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('APC-PRAC-033.c', 'APC-PRAC-033.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-033.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-033-c', 'APC-PRAC-033.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-033-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int factorial(int);
+
+int factorial(int n)
+{
+ int i, fact = 1;
+ for (i = 1; i <= n; i++)
+ fact *= i;
+ return fact;
+}
+
+int main()
+{
+ int n, temp;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+ if (n < 0)
+ {
+ printf("Only non-negetive number is allowed.");
+ return 1;
+ }
+ temp = n;
+ while (temp > 0)
+ {
+ printf("\nFactorial of %d: %d", 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('APC-PRAC-034.c', 'APC-PRAC-034.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-034.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-034-c', 'APC-PRAC-034.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-034-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int isPrime(int);
+
+int isPrime(int n)
+{
+ if (n <= 1)
+ return 0;
+ if (n == 2)
+ return 1;
+ if (n % 2 == 0)
+ return 0;
+ int temp = (int)sqrt(n), i;
+ for (i = 3; i <= temp; i += 2)
+ if (n % i == 0)
+ return 0;
+ return 1;
+}
+
+int main()
+{
+ int lb, ub, i;
+ printf("Enter the lower bound and the upper bound: ");
+ scanf("%d %d", &lb, &ub);
+ printf("\nPrime numbers between %d and %d: ", lb, ub);
+ for (i = lb; i <= ub; i++)
+ if (isPrime(i))
+ printf("%d ", 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('APC-PRAC-035.c', 'APC-PRAC-035.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-035.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-035-c', 'APC-PRAC-035.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-035-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int palindromeCheck(int);
+
+int palindromeCheck(int n)
+{
+ int temp = n, rev = 0;
+ while (temp > 0)
+ {
+ rev = (rev * 10) + (temp % 10);
+ temp /= 10;
+ }
+ if (rev == n)
+ return 1;
+ else
+ return 0;
+}
+
+int main()
+{
+ int i;
+ printf("Palindrome number of 3 and 4 digits: ");
+ for (i = 100; i <= 9999; i++)
+ if (palindromeCheck(i))
+ printf("%d ", 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('APC-PRAC-036.c', 'APC-PRAC-036.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-036.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-036-c', 'APC-PRAC-036.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-036-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int factorial(int);
+int checkKrishnamurty(int);
+
+int factorial(int n)
+{
+ int i, fact = 1;
+ for (i = 1; i <= n; i++)
+ fact *= i;
+ return fact;
+}
+
+int checkKrishnamurty(int n)
+{
+ int temp1 = n, temp2 = 0;
+ while (temp1 > 0)
+ {
+ temp2 += factorial(temp1 % 10);
+ temp1 /= 10;
+ }
+ if (temp2 == n)
+ return 1;
+ else
+ return 0;
+}
+
+int main()
+{
+ int n;
+ printf("Enter the number: ");
+ scanf("%d", &n);
+ if (checkKrishnamurty(n))
+ printf("\nInput %d is a Krishnamurty number.", n);
+ else
+ printf("\ninput %d is not a Krishnamurty number.", 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('APC-PRAC-037.c', 'APC-PRAC-037.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-037.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-037-c', 'APC-PRAC-037.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-037-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+#define lowerBound 100
+#define upperBound 999
+
+int isArmstrongNumber(int);
+
+int isArmstrongNumber(int n)
+{
+ int temp = n, sum = 0, count = 0;
+ while (temp > 0)
+ {
+ count++;
+ temp /= 10;
+ }
+ temp = n;
+ while (temp > 0)
+ {
+ sum += (int)pow(temp % 10, count);
+ temp /= 10;
+ }
+ return sum == n;
+}
+
+int main()
+{
+ int n, i, count = 0;
+ printf("Armstrong number between %d and %d are: ", lowerBound, upperBound);
+ for (i = lowerBound; i <= upperBound; i++)
+ if (isArmstrongNumber(i))
+ {
+ printf("%d ", i);
+ count++;
+ }
+ printf("\n\nCount: %d\n", 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('APC-PRAC-038.c', 'APC-PRAC-038.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-038.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-038-c', 'APC-PRAC-038.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-038-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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 <stdio.h>
+
+int main()
+{
+ printf("Combinations of two two-digit numbers such that the sum of digits of both numbers is equal: ");
+ int i, j, sum1, sum2, count = 0;
+ for (i = 10; i <= 99; i++)
+ {
+ sum1 = (i % 10) + (i / 10);
+ for (j = i + 1; j <= 99; j++)
+ {
+ sum2 = (j % 10) + (j / 10);
+ if (sum1 == sum2)
+ {
+ printf("(%d, %d) ", i, j);
+ count++;
+ }
+ }
+ }
+ printf("\nCount: %d\n", 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('APC-PRAC-039.c', 'APC-PRAC-039.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-039.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-039-c', 'APC-PRAC-039.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-039-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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 <stdio.h>
+
+int main()
+{
+ printf("a² + b² = c² : ");
+ int i, j, k, sq1, sq2, count = 0;
+ for (i = 1; i <= 30; i++)
+ {
+ sq1 = i * i;
+ for (j = i + 1; j <= 30; j++)
+ {
+ sq2 = j * j;
+ for (k = j + 1; k <= 30; k++)
+ {
+ if (sq1 + sq2 == k * k)
+ {
+ printf("(%d, %d, %d) ", i, j, k);
+ count++;
+ }
+ }
+ }
+ }
+ printf("\n\nCount: %d\n", 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('APC-PRAC-040.c', 'APC-PRAC-040.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-040.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-040-c', 'APC-PRAC-040.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-040-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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 <stdio.h>
+
+int main()
+{
+ int i, count = 0, n1, n2, n3;
+ printf("Distinct numbers between 100 and 999: ");
+ for (i = 100; i <= 999; i++)
+ {
+ n1 = i / 100;
+ n2 = (i % 100) / 10;
+ n3 = i % 10;
+ if (n1 != n2 && n2 != n3 && n1 != n3)
+ {
+ printf("%d ", i);
+ count++;
+ }
+ }
+ printf("\nCount: %d\n", 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('APC-PRAC-041.c', 'APC-PRAC-041.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-041.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-041-c', 'APC-PRAC-041.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-041-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*
+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 <stdio.h>
+#include <math.h>
+
+int isPrime(int n)
+{
+ if (n < 2)
+ return 0;
+ if (n == 2)
+ return 1;
+ if (n % 2 == 0)
+ return 0;
+ int i, temp = (int)sqrt(n);
+ for (i = 3; i <= temp; i += 2)
+ if (n % i == 0)
+ return 0;
+ return 1;
+}
+
+int main()
+{
+ int n, i, count = 0;
+ printf("enter the n: ");
+ scanf("%d", &n);
+ printf("\nAll the twin numbers: ");
+ for (i = 1; i <= n - 2; i++)
+ {
+ if (isPrime(i))
+ {
+ if (isPrime(i + 2))
+ {
+ printf("(%d, %d) ", i, i + 2);
+ count++;
+ }
+ }
+ }
+ printf("\nCount; %d", 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('APC-PRAC-042.c', 'APC-PRAC-042.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-PRAC-042.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-PRAC-042-c', 'APC-PRAC-042.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-PRAC-042-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a function to check whether a given string is a palindrome. Use this function to
+determine whether an entered string is Palindrome. */
+
+#include <stdio.h>
+#include <string.h>
+
+int isPalindrome(char[]);
+
+int main()
+{
+ char input[100];
+ int len;
+
+ printf("Enter the string (Max: 100 Character): ");
+ fgets(input, sizeof(input), stdin);
+ len = strlen(input);
+
+ if (len > 0 && input[len - 1] == '\n')
+ {
+ input[len - 1] = '\0';
+ }
+
+ if (isPalindrome(input))
+ {
+ printf("\nInput string \"%s\" is Palindrome.", input);
+ }
+ else
+ {
+ printf("\nInput string \"%s\" is not Palindrome", 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 < 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('APC-S-001.c', 'APC-S-001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-001-c', 'APC-S-001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+#include<stdio.h>
+int main() {
+ int a = 9, b = 4, c;
+ c = a + b;
+ printf("A + B = %d\n", c);
+ c = a / b;
+ printf("A / B = %d\n", c);
+ c = a % b;
+ printf("A %% B = %d\n", 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('APC-S-002.c', 'APC-S-002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-002-c', 'APC-S-002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+#include<stdio.h>
+int main() {
+ int a = 5, b = 5, c = 10;
+ printf("a = b = %d\n", a == b);
+ printf("a > b = %d\n", a > b);
+ printf("a < b = %d\n", 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('APC-S-003.c', 'APC-S-003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-003-c', 'APC-S-003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+#include <stdio.h>
+int main() {
+ int a = 5, b = 5, c = 10, result;
+
+ result = (a == b) && (c > b);
+ printf("Result is %d\n", result);
+
+ result = (a == b) && (c < b);
+ printf("Result is %d\n", result);
+
+ result = (a != b) || (c < b);
+ printf("Result is %d\n", result);
+
+ result = (a != b) || (c < b);
+ printf("Result is %d\n", result);
+
+ result = !(a != b);
+ printf("Result is %d\n", result);
+
+ result = !(a == b);
+ printf("Result is %d\n", 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('APC-S-004.c', 'APC-S-004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-004-c', 'APC-S-004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <conio.h>
+
+void main()
+{
+ clrscr();
+ int x;
+ x = 1;
+ while (x <= 10)
+ {
+ printf("%d ", 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('APC-S-005.c', 'APC-S-005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-005-c', 'APC-S-005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <conio.h>
+
+void main()
+{
+ clrscr();
+ int n, reverse = 0, rem;
+ printf("Enter the numner : ");
+ scanf("%d", &n);
+ while (n != 0)
+ {
+ rem = n % 10;
+ reverse = reverse * 10 + rem;
+ n /= 10;
+ }
+ printf("Reversed Number : %d", 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('APC-S-006.c', 'APC-S-006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-006-c', 'APC-S-006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <conio.h>
+
+void main()
+{
+ clrscr();
+ int a = 5, i = 1, res;
+ while (i <= 10)
+ {
+ res = a * i;
+ printf("%d * %d = %d\n", 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('APC-S-007.c', 'APC-S-007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-007-c', 'APC-S-007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <conio.h>
+
+void main()
+{
+ clrscr();
+ int i, sum = 0;
+ for (i = 1; i <= 10; i++)
+ {
+ sum += i;
+ }
+ printf("\nSum of the first natural number : %d", 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('APC-S-008.c', 'APC-S-008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-008-c', 'APC-S-008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to print the sum of two matrix as input given by the user. */
+/* Author: Amit Dutta, Date: 18-11-2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int rows, cols, i, j;
+ printf("Enter the number of rows and columns: ");
+ scanf("%d %d", &rows, &cols);
+
+ int a[rows][cols], b[rows][cols], c[rows][cols];
+
+ printf("Enter the elements of matrix A (%d x %d): \n", rows, cols);
+ for (i = 0; i < rows; i++)
+ for (j = 0; j < cols; j++)
+ {
+ printf("Position %d%d: ", i, j);
+ scanf("%d", &a[i][j]);
+ }
+ printf("\nMatrix A: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ printf("%d ", a[i][j]);
+ printf("\n");
+ }
+
+ printf("\nEnter the elements of matrix B(%d x %d): \n", rows, cols);
+ for (i = 0; i < rows; i++)
+ for (j = 0; j < cols; j++)
+ {
+ printf("Position %d%d: ", i, j);
+ scanf("%d", &b[i][j]);
+ }
+ printf("\nMatrix B: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ printf("%d ", b[i][j]);
+ printf("\n");
+ }
+
+ for (i = 0; i < rows; i++)
+ for (j = 0; j < cols; j++)
+ c[i][j] = a[i][j] + b[i][j];
+
+ printf("\nResult Matrix: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ printf("%d ", c[i][j]);
+ printf("\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('APC-S-009.c', 'APC-S-009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-009-c', 'APC-S-009.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to find the upper and lower triangular matrix. */
+/* Author: Amit Dutta, Date: 18-11-2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int i, j, rows, cols;
+ printf("\nEnter the number of rows and columns : ");
+ scanf("%d %d", &rows, &cols);
+
+ if (rows != cols)
+ {
+ printf("Triangular matrix definitions only apply to square matrices (rows == columns).\n");
+ return 1;
+ }
+
+ int matrix[rows][cols];
+
+ printf("Enter the elements of matrix (%d x %d): \n", rows, cols);
+ for (i = 0; i < rows; i++)
+ for (j = 0; j < cols; j++)
+ {
+ printf("Position %d%d: ", i, j);
+ scanf("%d", &matrix[i][j]);
+ }
+ printf("\nMatrix: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ printf("%d ", matrix[i][j]);
+ printf("\n");
+ }
+
+ printf("\nUpper triangular of the Matrix: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ {
+ if (j >= i)
+ printf("%d ", matrix[i][j]);
+ else
+ printf("~ ");
+ }
+ printf("\n");
+ }
+
+ printf("\nLower triangular of the Matrix: \n");
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ {
+ if (j <= i)
+ printf("%d ", matrix[i][j]);
+ else
+ printf("~ ");
+ }
+ printf("\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('APC-S-010.c', 'APC-S-010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-010-c', 'APC-S-010.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int a[8] = {4, 5, 2, 10, 6, 9, 8};
+ int i;
+
+ printf("Elemnts of the array: ");
+ for (i = 0; i <= 6; i++)
+ printf("%d ", a[i]);
+
+ printf("\nMethod 1: ");
+ for (i = 7; i >= 4; i--)
+ a[i] = a[i - 1];
+ a[3] = 7;
+ for (i = 0; i <= 7; i++)
+ printf("%d ", a[i]);
+
+ // another method
+ printf("\nMethod 2: ");
+ int b[8] = {4, 5, 2, 10, 6, 9, 8};
+ int temp1 = 7;
+ for (i = 3; i <= 7; i++)
+ {
+ int temp2 = b[i];
+ b[i] = temp1;
+ temp1 = temp2;
+ }
+ for (i = 0; i <= 7; i++)
+ printf("%d ", 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('APC-S-011.c', 'APC-S-011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-011-c', 'APC-S-011.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Linear search */
+/* Author: Amit Dutta, Date: 19-11-2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int elementCount, i, keyElement;
+
+ printf("Enter the number of element you want to add: ");
+ scanf("%d", &elementCount);
+
+ int elements[elementCount];
+
+ for (i = 0; i < elementCount; i++)
+ {
+ printf("Enter Element %d: ", i + 1);
+ scanf("%d", &elements[i]);
+ }
+
+ printf("\nEnter the Key Element you want to search: ");
+ scanf("%d", &keyElement);
+ for (i = 0; i < elementCount; i++)
+ if (elements[i] == keyElement)
+ {
+ printf("\nKey Element %d is found in %d position.", keyElement, i);
+ return 0;
+ }
+ printf("\nKey Element %d is not found.", 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('APC-S-012.c', 'APC-S-012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-012-c', 'APC-S-012.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to check if a matrix is a sparx matrix. */
+/* Author: Amit Dutta, Date: 19-11-2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int i, j, row, col, count = 0;
+
+ printf("Enter the number of rows and columns in the matrix: ");
+ scanf("%d %d", &row, &col);
+
+ int matrix[row][col];
+
+ for (i = 0; i < row; i++)
+ for (j = 0; j < col; j++)
+ {
+ printf("Postion %d%d: ", i, j);
+ scanf("%d", &matrix[i][j]);
+ if (matrix[i][j] == 0)
+ count++;
+ }
+
+ printf("\nEntered Matrix: \n");
+ for (i = 0; i < row; i++)
+ {
+ for (j = 0; j < col; j++)
+ printf("%d ", matrix[i][j]);
+ printf("\n");
+ }
+
+ if (count > (row * col) / 2)
+ printf("\nEntered matrix is a Sparx Matrix.");
+ else
+ printf("\nEntered matrix is not a Sparx Matrix");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('APC-S-013.c', 'APC-S-013.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-S-013.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-S-013-c', 'APC-S-013.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-S-013-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a fuction to calculate the average of an array */
+/* Author: Amit Dutta, Date: 26-11-2025 */
+
+#include <stdio.h>
+
+double average(int []);
+
+int main()
+{
+ int marks[10], i;
+ printf("\nEnter 10 numbers: \n");
+ for (i = 0; i <= 9; i++)
+ {
+ printf("Enter number %d: ", i + 1);
+ scanf("%d", &marks[i]);
+ }
+ printf("\nAverage = %g", average(marks));
+ return 0;
+}
+
+double average(int marks[10])
+{
+ int sum = 0;
+ for (int i = 0; i <= 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('APC-SPS-001.c', 'APC-SPS-001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-001-c', 'APC-SPS-001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+// WAP to perform arithmatic operation on integer data
+
+#include<stdio.h>
+int main() {
+ int a, b, sum, sub, multi, div, mod;
+ printf("Enter 1st number : ");
+ scanf("%d", &a);
+ printf("Enter 2nd number : ");
+ scanf("%d", &b);
+ sum = a + b;
+ sub = a - b;
+ multi = a * b;
+ div = a / b;
+ mod = a % b;
+ printf("\nSum = %d", sum);
+ printf("\nSubtraction = %d", sub);
+ printf("\nMultiplication = %d", multi);
+ printf("\nDivision = %d", div);
+ printf("\nModulas = %d", 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('APC-SPS-002.c', 'APC-SPS-002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-002-c', 'APC-SPS-002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to swap two integers. Display both numbers
+before and after swap */
+
+#include<stdio.h>
+int main() {
+ int a = 10, b = 20, temp;
+ printf("Before swap A : %d, B : %d", a, b);
+ temp = a;
+ a = b;
+ b = temp;
+ printf("\nAfter swap A : %d, B : %d", 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('APC-SPS-003.c', 'APC-SPS-003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-003-c', 'APC-SPS-003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Bitwise AND '&' */
+
+#include<stdio.h>
+int main() {
+ unsigned int a = 4, b = 5, c = 6;
+ unsigned int x, y;
+ x = a & b;
+ y = b & c;
+ printf("x = %u y = %u", 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('APC-SPS-004.c', 'APC-SPS-004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-004-c', 'APC-SPS-004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+#include<stdio.h>
+int main() {
+ int x = 25, y = 19, z;
+ z = x - y;
+ z = z & x ;
+ printf("Z = %d", 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('APC-SPS-005.c', 'APC-SPS-005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-005-c', 'APC-SPS-005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Bitwise OR '|' */
+
+#include<stdio.h>
+int main() {
+ int x = 12, y = 14, z = 10, res;
+ x++;
+ z++;
+ x = x + y + z;
+ res = x | y;
+ z = res | z;
+ printf("x = %d y = %d z = %d res = %d", 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('APC-SPS-006.c', 'APC-SPS-006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-006-c', 'APC-SPS-006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Bitwise NOT '~' */
+
+#include<stdio.h>
+int main() {
+ int x = 12, y = 15, z = 21;
+ int res, res1, res2;
+ res = x > 10;
+ res1 = ~res;
+ res2 = ~x;
+ printf("REs = %d, Res1 = %d, Res2 = %d", 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('APC-SPS-007.c', 'APC-SPS-007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-007-c', 'APC-SPS-007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to check a number is even or odd using bitwise operator */
+
+#include<stdio.h>
+int main() {
+ int x, res = 1;
+ printf("Enter a number : ");
+ scanf("%d", &x);
+ res = res & x;
+ if (res == 0) {
+ printf("\nInput %d is a even number.", x);
+ }
+ else {
+ printf("\nInput %d is a odd number.", 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('APC-SPS-008.c', 'APC-SPS-008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/APC-SPS-008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-APC-SPS-008-c', 'APC-SPS-008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-APC-SPS-008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate area of circle by accepting radius as input */
+/* Author : Amit Dutta, Date : 15th September, 2025 */
+
+#include<stdio.h>
+#include<math.h>
+int main() {
+ double r, area;
+ printf("Enter the radius of circle : ");
+ scanf("%lf", &r);
+ area = M_PI * r * r;
+ printf("\nArea : %lf", 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('P001.c', 'P001.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P001.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P001-c', 'P001.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P001-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+//sample code
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+int main() {
+ printf("Hello world");
+ return 0;
+}
+</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P002.c', 'P002.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P002.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P002-c', 'P002.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P002-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+//sample code with a new line charecter
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+int main() {
+ printf("Hello\nworld");
+ return 0;
+}
+</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P003.c', 'P003.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P003.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P003-c', 'P003.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P003-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+//WAP to perform addtion and multiplication of two integer numbers
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+int main() {
+ int a, b, sum, multi;
+ printf("Enter the 1st number : ");
+ scanf("%d",&a);
+ printf("Enter the 2nd number : ");
+ scanf("%d",&b);
+ sum = a + b;
+ multi = a * b;
+ printf("\nSum = %d"
+ "\nMultiplication = %d",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('P004.c', 'P004.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P004.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P004-c', 'P004.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P004-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ double x =5, result;
+ result = ((x + 3) / 4) - ((2 * x + 4) / 3);
+ printf("Result = %lf",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('P005.c', 'P005.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P005.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P005-c', 'P005.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P005-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ int daily_wage = 455, fine = 150, present, absent, income;
+ printf("No of days present : ");
+ scanf("%d", &present);
+ absent = 30 - present;
+ income = (present * 455) - (absent * 150);
+ printf("\nIncome : %d",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('P006.c', 'P006.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P006.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P006-c', 'P006.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P006-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ double f = 98.6, c;
+ c = ((f - 32) * 5) / 9;
+ printf("Temperature in Celcius is : %lf",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('P007.c', 'P007.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P007.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P007-c', 'P007.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P007-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ double mrp, final_price, temp;
+ printf("Enter the printed price : ");
+ scanf("%lf", &mrp);
+ temp = mrp * 0.90;
+ final_price = temp * 1.06;
+ printf("\nCustomer have to pay : %lf", 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('P008.c', 'P008.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P008.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P008-c', 'P008.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P008-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ double mrp, shop1, shop2, temp;
+ printf("Enter the price : ");
+ scanf("%lf", &mrp);
+ shop1 = mrp * 0.70;
+ temp = mrp * 0.80;
+ shop2 = temp * 0.90;
+ printf("\nShopkeeper 1 price : %lf"
+ "\nShopkeeper 2 price : %lf",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('P009.c', 'P009.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P009.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P009-c', 'P009.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P009-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+int main() {
+ double bs, da, hra, pf, gs, ns;
+ printf("Enter the Basic Salary : ");
+ scanf("%lf", &bs);
+ da = bs * 0.3;
+ hra = bs * 0.2;
+ pf = bs * 0.125;
+ gs = bs + da + hra;
+ ns = gs - pf;
+ printf("\nGross Salary : %lf"
+ "\nNet Salary : %lf", 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('P010.c', 'P010.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P010.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P010-c', 'P010.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P010-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+#include<math.h>
+int main() {
+ double p, r, t, si, a, ci, dif;
+ printf("Enter the principle amount, rate of interest, time in year : ");
+ scanf("%lf %lf %lf", &p, &r, &t);
+ si = (p * r * t) / 100;
+ a = p * pow((1 + (r / 100)), t);
+ ci = a - p;
+ dif = ci - si;
+ printf("\nSimple Interest : %lf"
+ "\nCompound Interest : %lf"
+ "\nInterest Difference : %lf", 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('P011.c', 'P011.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P011.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P011-c', 'P011.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P011-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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<stdio.h>
+#include<math.h>
+int main() {
+ double l, g, t;
+ printf("Enter the Length and Gravity measures : ");
+ scanf("%lf %lf", &l, &g);
+ t = 2 * M_PI * sqrt(l / g);
+ // using M_PI variable for PI value from math.h header file
+ printf("\nTime Period : %lf", 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('P012.c', 'P012.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P012.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P012-c', 'P012.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P012-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to swap two integer variable without
+using third variable */
+// using Approch Mode : simple, slow, time consuming
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+int main() {
+ int a = 4, b = 6;
+ printf("Before Swap : A = %d, B = %d", a, b);
+ a = a + b;
+ b = a - b;
+ a = a - b;
+ printf("\nAfter Swap : A = %d, B = %d", 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('P013.c', 'P013.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P013.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P013-c', 'P013.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P013-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to swap two integer variable without
+using third variable */
+// using Approch Mode : complex, fast, less time consumimg
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+#include<math.h>
+int main() {
+ int a = 4, b = 6;
+ printf("Before Swap : A = %d, B = %d", a, b);
+ a = a ^ b;
+ b = a ^ b;
+ a = a ^ b;
+ printf("\nAfter Swap : A = %d, B = %d", 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('P014.c', 'P014.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P014.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P014-c', 'P014.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P014-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to accept the diagonal of
+square. Find and display the area and
+perimeter of the square. */
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+#include<math.h>
+int main() {
+ double d, side, area, per;
+ printf("Enter the diagonal : ");
+ scanf("%lf", &d);
+ side = d / sqrt (2);
+ area = side * side;
+ per = 4 * side;
+ printf("\nArea of the Square : %lf"
+ "\nPerimeter of the Square : %lf", 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('P015.c', 'P015.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P015.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P015-c', 'P015.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P015-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/*WAP to accept number of days and
+display it after converting into
+number of years, months and days */
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+int main() {
+ int day, month, year, temp;
+ printf("Enter the number of days : ");
+ scanf("%d", &day);
+ temp = day;
+ year = day / 365;
+ day = day % 365;
+ month = day / 30;
+ day = day % 30;
+ printf("\n%d Days = %d Years %d Months %d Days", 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('P016.c', 'P016.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P016.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P016-c', 'P016.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P016-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate and display radius of a
+circle by taking the area as input */
+// Author - Amit Dutta, Date - Unknown
+
+#include<stdio.h>
+#include<math.h>
+int main() {
+ double area, r;
+ printf("Enter the area of a circle : ");
+ scanf("%lf", &area);
+ r = sqrt((7 * area) / 22);
+ printf("\nRadius : %lf", 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('P017.c', 'P017.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P017.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P017-c', 'P017.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P017-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Find maximum between three number. */
+// Author - Amit Dutta, Date - Unknown
+
+#include <stdio.h>
+int main()
+{
+ int a, b, c, max;
+ printf("Enter the value for a, b, c : ");
+ scanf("%d %d %d", &a, &b, &c);
+ max = a;
+ if (max < b)
+ max = b;
+ if (max < c)
+ max = c;
+ printf("Maximum : %d", 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('P018.c', 'P018.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P018.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P018-c', 'P018.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P018-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double cost, sell, pro, prop, loss, lossp;
+ printf("Enter the cost and selling price : ");
+ scanf("%lf %lf", &cost, &sell);
+ if (sell > cost)
+ {
+ pro = sell - cost;
+ prop = (pro / cost) * 100;
+ printf("Profit : RS %g, Profit Percentage : %g", pro, prop);
+ }
+ else if (sell < cost)
+ {
+ loss = cost - sell;
+ lossp = (loss / cost) * 100;
+ printf("Loss : RS %g, Loss Percentage : %g", loss, lossp);
+ }
+ else
+ printf("Neither loss nor Profit.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P019.c', 'P019.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P019.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P019-c', 'P019.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P019-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to input the distance covered and calculate
+the amount to be paid by the passanger.
+ Distance Rate
+ =<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 <stdio.h>
+int main()
+{
+ double dis, amt;
+ printf("Enter the distance : ");
+ scanf("%lf", &dis);
+ if (dis <= 5.0)
+ amt = 90.0;
+ else if (dis > 5.0 && dis <= 15.0)
+ amt = 90.0 + (dis - 5.0) * 20;
+ else if (dis > 15.0 && dis <= 25.0)
+ amt = 90.0 + 200.0 + (dis - 15.0) * 10;
+ else if (dis > 25.0)
+ amt = 90.0 + 200.0 + 100.0 + (dis - 25.0) * 9;
+ printf("\nAmount to be paid : %g", 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('P020.c', 'P020.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P020.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P020-c', 'P020.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P020-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double nod, amt, s, i;
+ printf("Enter the amount and the time in days : ");
+ scanf("%lf %lf", &s, &nod);
+ if (nod <= 180)
+ i = (s * 5.5 * (nod / 365)) / 100;
+ else if (nod > 180.0 && nod <= 364.0)
+ i = (s * 7.5 * (nod / 365)) / 100;
+ else if (nod == 365.0)
+ i = (s * 9.0 * 1) / 100;
+ else if (nod > 365.0)
+ i = (s * 8.5 * (nod / 365)) / 100;
+ amt = s + i;
+ printf("Amount to be paid : %g", 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('P021.c', 'P021.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P021.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P021-c', 'P021.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P021-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+int main()
+{
+ int n, temp;
+ double sr;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ sr = sqrt(n);
+ temp = (int)sr;
+ if (temp * temp == n)
+ printf("\nThis is a perfect square.");
+ else
+ printf("\nThis is not a perfect square.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P022.c', 'P022.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P022.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P022-c', 'P022.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P022-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int a, b, c, min;
+ printf("Enter three number : ");
+ scanf("%d %d %d", &a, &b, &c);
+ min = (a < b && a < c) ? a : (b < a && b < c) ? b
+ : c;
+ printf("Minimum = %d", 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('P023.c', 'P023.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P023.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P023-c', 'P023.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P023-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double cost, amt;
+ printf("Enter the total cost : ");
+ scanf("%lf", &cost);
+ if (cost <= 2000)
+ amt = cost * 0.94;
+ else if (cost > 2000 && cost <= 5000)
+ amt = cost * 0.9;
+ else if (cost > 5000 && cost <= 10000)
+ amt = cost * 0.85;
+ else if (cost > 10000)
+ amt = cost * 0.8;
+ printf("\nAmount to be paid : %g", 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('P024.c', 'P024.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P024.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P024-c', 'P024.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P024-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &year);
+ if (year % 4 == 0 && year % 100 != 0)
+ printf("\nYear %d is a leapyear.", year);
+ else if (year % 400 == 0)
+ printf("\nYear %d is a leapyear (Century).", year);
+ else
+ printf("\nYear %d is not a leapyear.", 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('P025.c', 'P025.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P025.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P025-c', 'P025.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P025-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ double unit, amt;
+ printf("Enter the electricity consp(unit) : ");
+ scanf("%lf", &amt);
+ if (unit <= 50)
+ amt = unit * 0.50;
+ else if (unit > 50 && unit <= 50)
+ amt = 25 + ((unit - 50) * 0.75);
+ else if (unit > 150 && unit <= 250)
+ amt = 25 + 75 + ((unit - 150) * 1.20);
+ else if (unit > 250)
+ amt = 25 + 75 + 120 + ((unit - 250) * 1.50);
+ amt = amt * 1.20;
+ printf("\nAmount to be paid : %g", 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('P026.c', 'P026.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P026.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P026-c', 'P026.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P026-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to input sum (p), rate of interest (r), time (t) and type of interest
+('s' for simple interest amd 'c' 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 <stdio.h>
+#include <math.h>
+#include <ctype.h>
+int main()
+{
+ double principalAmount, rateOfInterest, timePeriod, simpleInterest, compoundInterest;
+ char mode;
+ printf("Enter the principle amount, Rate of interest, Time : ");
+ scanf("%lf %lf %lf", &principalAmount, &rateOfInterest, &timePeriod);
+ printf("\nEnter the mode ('s' : simple interest, 'c' : compound interest) : ");
+ scanf(" %c", &mode);
+ mode = tolower(mode);
+ switch (mode)
+ {
+ case 's':
+ simpleInterest = (principalAmount * rateOfInterest * timePeriod) / 100;
+ printf("\nSimple Interest : %g", simpleInterest);
+ break;
+ case 'c':
+ compoundInterest = principalAmount * (pow((1 + rateOfInterest / 100), timePeriod) - 1);
+ printf("\nCompound Interest : %g", compoundInterest);
+ break;
+ default:
+ printf("\nInvalid Input");
+ 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('P027.c', 'P027.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P027.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P027-c', 'P027.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P027-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 ('L' : laptop, 'D' : 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 <stdio.h>
+#include <ctype.h>
+int main()
+{
+ double principal_amount, desktop_discount, laptop_discount, discount_amount, discounted_price;
+ char choice;
+ printf("Enter the purchase amount : ");
+ scanf("%lf", &principal_amount);
+ printf("Type of purchase ('L' : Laptop, 'D' : Desktop) : ");
+ scanf(" %c", &choice);
+ choice = toupper(choice);
+ if (principal_amount <= 20000)
+ {
+ laptop_discount = 0.03;
+ desktop_discount = 0.05;
+ }
+ else if (principal_amount > 20000 && principal_amount <= 50000)
+ {
+ laptop_discount = 0.05;
+ desktop_discount = 0.075;
+ }
+ else if (principal_amount > 50000 && principal_amount <= 75000)
+ {
+ laptop_discount = 0.075;
+ desktop_discount = 0.105;
+ }
+ else if (principal_amount > 75000)
+ {
+ laptop_discount = 0.1;
+ desktop_discount = 0.15;
+ }
+ switch (choice)
+ {
+ case 'L':
+ discount_amount = principal_amount * laptop_discount;
+ discounted_price = principal_amount - discount_amount;
+ printf("\nDiscount Amount : %g"
+ "\nDiscounted Price : %g",
+ discount_amount, discounted_price);
+ break;
+ case 'D':
+ discount_amount = principal_amount * desktop_discount;
+ discounted_price = principal_amount - discount_amount;
+ printf("\nDiscount Amount : %g"
+ "\nDiscounted Price : %g",
+ discount_amount, discounted_price);
+ break;
+ default:
+ printf("\nInvalid Input.");
+ 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('P028.c', 'P028.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P028.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P028-c', 'P028.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P028-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate factorial of a number */
+/* Author - Amit Dutta, Date - 11th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int i = 1, num, fact = 1;
+ printf("Enter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ return 1;
+ }
+ if (num == 0)
+ {
+ printf("\nFactorial of 0 : 1");
+ return 0;
+ }
+ if (num < 0)
+ {
+ printf("\nFactorial of %d : UNDEFINED", num);
+ return 0;
+ }
+ while (i <= num)
+ {
+ fact = fact * i;
+ i++;
+ }
+ printf("Factorial of %d : %d", num, fact);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P029.c', 'P029.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P029.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P029-c', 'P029.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P029-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ... */
+/* Author - Amit Dutta, Date - 11th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int num, i = 0, result = 0;
+ printf("Enter the value for n : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nPlease enter a number.");
+ return 1;
+ }
+ if (num < 1)
+ {
+ printf("\nPlease enter a positive number.");
+ return 1;
+ }
+ while (i <= num)
+ {
+ result = result + i;
+ i++;
+ }
+ printf("\nResult : %d", result);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P030.c', 'P030.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P030.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P030-c', 'P030.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P030-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Display the first 15 terms of the series. */
+/* Author - Amit Dutta, Date - 11th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int i, r;
+
+ // 3, 6, 9, 12, ...
+ {
+ i = 3, r = 0;
+ printf("Series 1 (3, 6, 9, 12, ...) :");
+ while (i <= 15)
+ {
+ r = r + 3;
+ printf(" %d", r);
+ i++;
+ }
+ }
+
+ // 1, 4, 9, 16, ...
+ {
+ i = 1;
+ printf("\nSeries 2 (1, 4, 9, 16, ...) :");
+ while (i <= 15)
+ {
+ printf(" %d", i * i);
+ i++;
+ }
+ }
+
+ // 4, 8, 16, 32, ...
+ {
+ i = 1, r = 2;
+ printf("\nSeries 3 (4, 8, 16, 32, ...) :");
+ while (i <= 15)
+ {
+ r = r * 2;
+ printf(" %d", r);
+ i++;
+ }
+ }
+
+ // 0, 7, 26, ...
+ {
+ i = 1, r;
+ printf("\nSeries 4 (0, 7, 26, ...) :");
+ while (i <= 15)
+ {
+ r = (int)pow(i, 3) - 1;
+ printf(" %d", r);
+ i++;
+ }
+ }
+
+ return 0;
+}
+</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P031.c', 'P031.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P031.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P031-c', 'P031.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P031-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Find the sum of the series */
+/* Author - Amit Dutta, Date - 11th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ double a, res, n;
+ int i;
+
+ // s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10)
+ {
+ res = 0, i = 1;
+ printf("--- s = (a ^ 2) + (a ^ 2 / 2) + (a ^ 2 / 3) + ... + (a ^ 2 / 10) ---");
+ printf("\nEnter the number : ");
+ scanf("%lf", &a);
+ while (i <= 10)
+ {
+ res = res + ((a * a) / i);
+ i++;
+ }
+ printf("S = %g", res);
+ }
+
+ // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n
+ {
+ res = 0, i = 0;
+ printf("\n--- // s = 1 + (2 ^ 2 / a) + (3 ^ 3 / a ^ 2) + ... + n ---");
+ printf("\nEnter the value for a and n : ");
+ scanf(" %lf %lf", &a, &n);
+ while (i <= n - 1)
+ {
+ res = res + (pow(i + 1, i + 1) / pow(a, i));
+ i++;
+ }
+ printf("S = %g", res);
+ }
+
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P032.c', 'P032.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P032.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P032-c', 'P032.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P032-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to input a number and check whether it is a Niven number
+or not. (When a number is divisible by its sum of digit) e.g. : n = 126*/
+/* Author - Amit Dutta, Date - 11th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int n, temp, sod = 0;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ temp = n;
+ while (temp > 0)
+ {
+ sod = sod + (temp % 10);
+ temp = temp / 10;
+ }
+ if (n % sod == 0)
+ printf("\nIt is Niven number.");
+ else
+ printf("\nIt is not a Niven number.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P033.c', 'P033.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P033.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P033-c', 'P033.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P033-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to calculate the sum of even digits and odd digits. Number will be provided by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, odd = 0, even = 0, temp;
+ printf("Enter the number : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ }
+ printf("\nSum of even : %d"
+ "\nSum of odd : %d",
+ even, odd);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P034.c', 'P034.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P034.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P034-c', 'P034.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P034-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Get sum of even position digit and odd position digit */
+/* Counting starts from the rightmost digit as position 1 (Odd). */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int inp, temp, index = 1, even = 0, odd = 0;
+ printf("Enter the numebr : ");
+ scanf("%d", &inp);
+ temp = inp;
+ while (temp > 0)
+ {
+ if (index % 2 == 0)
+ even += temp % 10;
+ else
+ odd += temp % 10;
+ temp /= 10;
+ index++;
+ }
+ printf("\nSum of even position digits : %d"
+ "\nSum of odd position digits : %d",
+ even, odd);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P035.c', 'P035.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P035.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P035-c', 'P035.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P035-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* WAP to input an int number and display the product of the successors
+of even digits of the number entered by user. */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <stdbool.h>
+int main()
+{
+ int n, res = 1, temp;
+ bool status = false;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ temp = n;
+ while (temp > 0)
+ {
+ if ((temp % 10) % 2 == 0)
+ {
+ res *= (temp % 10) + 1;
+ status = true;
+ }
+ temp /= 10;
+ }
+ if (!status)
+ printf("\nThere is no even digits.");
+ else
+ printf("\nThe product of the successors of even digits of the number %d is : %d", n, res);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P036.c', 'P036.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P036.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P036-c', 'P036.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P036-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ double a, sum = 0;
+ int n, i;
+ printf("Enter value for a and n : ");
+ scanf("%lf %d", &a, &n);
+ for (i = 1; i <= n; i++)
+ sum += pow(a, i) / i;
+ printf("\nSum = %g", sum);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P037.c', 'P037.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P037.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P037-c', 'P037.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P037-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n */
+/* Author - Amit Dutta, Date - 18th OCT, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ double sum = 0, temp1 = 0, temp2 = 1;
+ int n, i;
+ printf("Enter value for n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ temp1 += i;
+ temp2 *= i;
+ sum += temp1 / temp2;
+ }
+ printf("\nSum = %g", sum);
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P038.c', 'P038.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P038.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P038-c', 'P038.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P038-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to check prime number */
+/* Author - Amit Dutta, Date - 27th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+#include <stdbool.h>
+
+int main()
+{
+ int num, i, endCheckDigit;
+ bool isPrime = true;
+ printf("Enter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nOnly a number is allowed, not a character.");
+ return 1;
+ }
+ if (num <= 0)
+ {
+ printf("\nOnly postive number is allowed.");
+ return 1;
+ }
+ if (num == 1)
+ {
+ printf("\nInput 1 is not a prime number."
+ "\nHas only one positive divisor (itself), not exactly two."
+ "\nRule: Prime number should have exactly two distinct positive divisors: 1 and itself");
+ return 0;
+ }
+ if (num == 2)
+ {
+ printf("\nInput 2 is a prime number."
+ "\n(Note: 2 is only Even Prime Number)");
+ return 0;
+ }
+ if (num % 2 == 0)
+ {
+ printf("\nInput %d is not a prime number.", num);
+ return 0;
+ }
+ endCheckDigit = sqrt(num);
+ for (i = 3; i <= endCheckDigit; i += 2)
+ {
+ if (num % i == 0)
+ {
+ isPrime = false;
+ printf("\nInput %d is not prime number.", num);
+ return 0;
+ }
+ }
+ if (isPrime)
+ {
+ printf("\nInput %d is a prime number.", 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('P039.c', 'P039.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P039.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P039-c', 'P039.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P039-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to print all the factors of a postive integer */
+/* Author - Amit Dutta, Date - 27th OCT, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int num, i;
+ printf("Enter a number : ");
+ scanf("%d", &num);
+ printf("\nFactors of %d : ", num);
+ for (i = 1; i <= num / 2; i++)
+ {
+ if (num % i == 0)
+ {
+ printf(" %d", 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('P040.c', 'P040.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P040.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P040-c', 'P040.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P040-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to calculate HCF of two positive number */
+/* Author - Amit Dutta, Date - 27th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int a, b, temp;
+ printf("Enter two number : ");
+ scanf("%d %d", &a, &b);
+ while (b > 0)
+ {
+ temp = a;
+ a = b;
+ b = temp % b;
+ }
+ printf("HCF = %d", 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('P041.c', 'P041.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P041.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P041-c', 'P041.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P041-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+int main()
+{
+ int a, b, temp, temp_a, temp_b;
+ printf("Enter two number : ");
+ scanf("%d %d", &a, &b);
+ temp_a = a;
+ temp_b = b;
+ while (b > 0)
+ {
+ temp = a;
+ a = b;
+ b = temp % b;
+ }
+ if (a == 1)
+ {
+ printf("\n(%d, %d) is co-prime.", temp_a, temp_b);
+ }
+ else
+ {
+ printf("\n(%d, %d) is not co-prime.", 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('P042.c', 'P042.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P042.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P042-c', 'P042.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P042-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int n, t, i, r, rev, prime = 1;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ for (i = 2; i <= (int)sqrt(n); i++)
+ {
+ if (n % i == 0)
+ {
+ prime = 0;
+ break;
+ }
+ }
+ if (prime)
+ {
+ printf("%d is a prime number.", n);
+ t = n;
+ rev = 0;
+ prime = 1;
+ while (t > 0)
+ {
+ r = t % 10;
+ rev = rev * 10 + r;
+ t = t / 10;
+ }
+ for (i = 2; i <= (int)sqrt(rev); i++)
+ {
+ if (rev % i == 0)
+ {
+ prime = 0;
+ break;
+ }
+ }
+ if (prime)
+ {
+ printf("\n%d and %d are prime numbers.. TWISTED PRIME", n, rev);
+ }
+ else
+ {
+ printf("\n%d is non prime", rev);
+ }
+ }
+ else
+ {
+ printf("\n%d is non prime.", 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('P043.c', 'P043.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P043.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P043-c', 'P043.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P043-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Write a program to check palindrome number. */
+/* Author - Amit Dutta, Date - 27th OCT, 2025 */
+
+#include <stdio.h>
+int main()
+{
+ int num, temp, rev;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ temp = num;
+ rev = 0;
+ while (temp > 0)
+ {
+ rev = (rev * 10) + (temp % 10);
+ temp /= 10;
+ }
+ if (num == rev)
+ {
+ printf("%d is a palindrome number.", num);
+ }
+ else
+ {
+ printf("%d is not a palindrome number.", 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('P044.c', 'P044.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P044.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P044-c', 'P044.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P044-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+#include <stdbool.h>
+
+int main()
+{
+ int num, iterationIndex;
+ bool isPronic = false;
+ printf("Enter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nYou have to enter a number, not an character or symbol.");
+ return 1;
+ }
+ if (num < 1)
+ {
+ printf("\nOnly postive number is allowed.");
+ return 1;
+ }
+ for (iterationIndex = 1; iterationIndex <= num / 2; iterationIndex++)
+ {
+ if (iterationIndex * (iterationIndex + 1) == num)
+ {
+ printf("\nInput %d is a Pronic Number.", num);
+ isPronic = true;
+ break;
+ }
+ }
+ if(!isPronic)
+ {
+ printf("\nInput %d is not a Pronic Number.", num);
+ }
+ return 0;
+}
+*/
+
+// using direct return method (more efficient and generally preferred)...
+
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num, iterationIndex, iterationLimit;
+ printf("Enter the number : ");
+ if (scanf("%d", &num) != 1)
+ {
+ printf("\nYou have to enter a number, not an character or symbol.");
+ return 1;
+ }
+ if (num < 1)
+ {
+ printf("\nOnly postive number is allowed.");
+ return 1;
+ }
+ iterationLimit = (int)sqrt(num);
+ for (iterationIndex = 1; iterationIndex <= iterationLimit; iterationIndex++)
+ {
+ if (iterationIndex * (iterationIndex + 1) == num)
+ {
+ printf("\nInput %d is a Pronic Number.", num);
+ return 0;
+ }
+ }
+ printf("\nInput %d is not a Pronic Number.", 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('P045.c', 'P045.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P045.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P045-c', 'P045.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P045-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", j);
+ }
+ printf("\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('P046.c', 'P046.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P046.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P046-c', 'P046.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P046-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = i; j >= 1; j--)
+ {
+ printf("%d\t", j);
+ }
+ printf("\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('P047.c', 'P047.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P047.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P047-c', 'P047.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P047-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int i, j, n;
+ printf("Enter n : ");
+ scanf("%d", &n);
+ for (i = n; i >= 1; i--)
+ {
+ for (j = n; j >= i; j--)
+ {
+ printf("%d\t", j);
+ }
+ printf("\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('P048.c', 'P048.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P048.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P048-c', 'P048.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P048-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int i, j, n, temp = 1;
+ printf("Enter row number : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d\t", temp);
+ temp++;
+ }
+ printf("\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('P049.c', 'P049.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P049.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P049-c', 'P049.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P049-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* Make this pattern for input n no of row.
+ Pattern :
+ #
+ @ @
+ # # #
+ @ @ @ @
+ # # # # #
+ */
+/* Author - Amit Dutta, Date - 01st NOVEMBER, 2025 */
+
+#include <stdio.h>
+
+int main()
+{
+ int i, j, n;
+ char a = '#', b = '@';
+ printf("Enter row number : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ if (i % 2 == 0)
+ printf("%c\t", b);
+ else
+ printf("%c\t", a);
+ }
+ printf("\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('P050-SHORT.c', 'P050-SHORT.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P050-SHORT.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P050-SHORT-c', 'P050-SHORT.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P050-SHORT-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ int position = printf("%d", num);
+ int temp = num;
+ int res = 0;
+ while (temp > 0)
+ {
+ res += (int)pow(temp % 10, position);
+ position--;
+ temp /= 10;
+ }
+ if (res == num)
+ printf(" is a Disarium Number.");
+ else
+ printf(" is Not a Disarium Number.");
+ return 0;
+}</div>
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
- <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('P050.c', 'P050.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P050.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P050-c', 'P050.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P050-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+#include <math.h>
+
+int main()
+{
+ int num, res = 0, temp, position = 0;
+ printf("Enter the number : ");
+ scanf("%d", &num);
+ temp = num;
+ while (temp > 0)
+ {
+ position++;
+ temp /= 10;
+ }
+ temp = num;
+ while (temp > 0)
+ {
+ res += (int)pow(temp % 10, position);
+ position--;
+ temp /= 10;
+ }
+ if (res == num)
+ printf("\nInput %d is a Disarium Number.", num);
+ else
+ printf("\nInput %d is Not a Disarium Number.", 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('P051.c', 'P051.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P051.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P051-c', 'P051.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P051-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int a, b, i, sa = 0, sb = 0;
+ printf("Enter two number : ");
+ scanf("%d %d", &a, &b);
+ for (i = 1; i <= a / 2; i++)
+ if (a % i == 0)
+ sa += i;
+ for (i = 1; i <= b / 2; i++)
+ if (b % i == 0)
+ sb += i;
+ if (sa == b && sb == a)
+ printf("\nInput %d and %d is Amicable Pair.", a, b);
+ else
+ printf("\nInput %d and %d is Not Amicable Pair.", 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('P052.c', 'P052.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P052.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P052-c', 'P052.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P052-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int n, sum = 0, temp = 0, i;
+ printf("Enter the n : ");
+ scanf("%d", &n);
+ for (i = 1; i <= n; i++)
+ {
+ temp += i;
+ sum += temp;
+ }
+ printf("%d", 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('P053.c', 'P053.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P053.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P053-c', 'P053.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P053-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int main()
+{
+ int i, j, temp;
+
+ printf("\n\nPattern 1 : \n\n");
+ /*
+ 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 <= 5; i++)
+ {
+ for (j = 1; j <= 5; j++)
+ {
+ printf("%d ", temp);
+ }
+ printf("\n");
+ temp -= 2;
+ }
+
+ // Another method print above pattern
+ printf("\n\nPattern 1 : \n\n");
+ for (i = 9; i >= 1; i -= 2)
+ {
+ for (j = 1; j <= 5; j++)
+ {
+ printf("%d ", i);
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 2 : \n\n");
+ /*
+ 1 2 3 4 5
+ 1 2 3 4 5
+ 1 2 3 4 5
+ */
+ for (i = 1; i <= 3; i++)
+ {
+ for (j = 1; j <= 5; j++)
+ {
+ printf("%d ", j);
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 3 : \n\n");
+ /*
+ 5 4 3 2 1
+ 5 4 3 2 1
+ */
+ for (i = 1; i <= 2; i++)
+ {
+ for (j = 5; j >= 1; j--)
+ {
+ printf("%d ", j);
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 4 : \n\n");
+ /*
+ 1 2 3 4
+ 5 6 7 8
+ 9 10 11 12
+ */
+ temp = 1;
+ for (i = 1; i <= 3; i++)
+ {
+ for (j = 1; j <= 4; j++)
+ {
+ printf("%d ", temp);
+ temp++;
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 5 : \n\n");
+ /*
+ 1 2 3 4
+ 4 8 12 16
+ 1 2 3 4
+ 4 8 12 16
+ 1 2 3 4
+ */
+ for (i = 1; i <= 5; i++)
+ {
+ for (j = 1; j <= 4; j++)
+ {
+ if (i % 2 == 0)
+ printf("%d ", j * 4);
+ else
+ printf("%d ", j);
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 6 : \n\n");
+ /*
+ 1
+ 2 4
+ 3 5 7
+ 6 8 10 12
+ 9 11 13 15 17
+ */
+ int odd = 1, even = 2;
+ for (i = 1; i <= 5; i++)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ if (i % 2 == 0)
+ {
+ printf("%d ", even);
+ even += 2;
+ }
+ else
+ {
+ printf("%d ", odd);
+ odd += 2;
+ }
+ }
+ printf("\n");
+ }
+
+ printf("\n\nPattern 7 : \n\n");
+ /*
+ 1 2 3 4 5
+ 6 7 8 9
+ 10 11 12
+ 13 14
+ 15
+ */
+ temp = 1;
+ for (i = 5; i >= 1; i--)
+ {
+ for (j = 1; j <= i; j++)
+ {
+ printf("%d ", temp);
+ temp++;
+ }
+ printf("\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('P054.c', 'P054.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P054.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P054-c', 'P054.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P054-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int fact(int);
+int isKrishnamurty(int);
+
+int fact(int n)
+{
+ int fact = 1, i;
+ for (i = 1; i <= n; i++)
+ fact *= i;
+ return fact;
+}
+
+int isKrishnamurty(int n)
+{
+ int temp = n, sum = 0;
+ while (temp > 0)
+ {
+ sum += fact(temp % 10);
+ temp /= 10;
+ }
+ return n == sum;
+}
+
+int main()
+{
+ int n;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ if (isKrishnamurty(n))
+ printf("\nInput %d is a Krishnamurty Number.", n);
+ else
+ printf("\nInput %d is not a Krishnamurty number.", 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('P055.c', 'P055.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P055.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P055-c', 'P055.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P055-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void printFibonacci(int);
+
+void printFibonacci(int n)
+{
+ int val1 = 0, val2 = 1, val3, i;
+ printf("\nFibonacci series upto %d terms :", n);
+ if (n < 0)
+ printf(" N/A");
+ if (n == 0)
+ printf(" %d", val1);
+ if (n > 0)
+ printf(" %d %d", val1, val2);
+ for (i = 2; i <= n; i++)
+ {
+ val3 = val1 + val2;
+ printf(" %d", val3);
+ val1 = val2;
+ val2 = val3;
+ }
+}
+
+int main()
+{
+ int n;
+ printf("Enter the n : ");
+ scanf("%d", &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('P056.c', 'P056.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P056.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P056-c', 'P056.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P056-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void swap(int *a, int *b)
+{
+ int temp = *a;
+ *a = *b;
+ *b = temp;
+}
+
+int main()
+{
+ int a, b;
+ printf("Enter A and B: ");
+ scanf("%d %d", &a, &b);
+ printf("\nBefore swap A: %d, B: %d", a, b);
+ swap(&a, &b);
+ printf("\nAfter swap A: %d, B: %d", 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('P057.c', 'P057.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P057.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P057-c', 'P057.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P057-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void series(int n)
+{
+ int i;
+ printf("\nSeries: ");
+ for (i = 1; i <= n; i++)
+ printf("%d ", (i * i * i) - 1);
+}
+
+int main()
+{
+ int n;
+ printf("Enter n: ");
+ scanf("%d", &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('P058.c', 'P058.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P058.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P058-c', 'P058.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P058-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+void displayASCII()
+{
+ int i;
+ printf("ASCII Code\t\tCharacter");
+ for (i = 'A'; i <= 'Z'; i++)
+ printf("\n%c\t\t%d", 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('P059.c', 'P059.c', 'https:/raw.githubusercontent.com/notamitgamer/bsc/main/tuition-c/P059.c')">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-tuition-c-P059-c', 'P059.c', 'https://github.com/notamitgamer/bsc/blob/main/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/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">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/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-tuition-c-P059-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * ======================================================================================
+ * Repository: https://github.com/notamitgamer
+ * Author : Amit Dutta
+ * License : EDUCATIONAL SOURCE-AVAILABLE LICENSE (ESAL-1.0)
+ * ======================================================================================
+ *
+ * [ IMPORTANT LEGAL NOTICE ]
+ *
+ * 1. PROPRIETARY STATUS:
+ * This software ("The Software") is the intellectual property of Amit Dutta.
+ * It is NOT "Open Source" in the traditional sense. It is "Source-Available"
+ * for educational observation only.
+ *
+ * 2. ACADEMIC INTEGRITY & RESTRICTION:
+ * The use of this code, in whole or in part, for the purpose of submitting
+ * academic assignments, projects, lab reports, or examinations at
+ * WEST BENGAL STATE UNIVERSITY (WBSU) or any other educational institution
+ * is STRICTLY PROHIBITED.
+ *
+ * >>> VIOLATION OF THIS CLAUSE WILL BE REPORTED AS ACADEMIC MISCONDUCT. <<<
+ *
+ * 3. PERMISSIONS:
+ * You are granted a revocable license to:
+ * - Read and study the code to understand algorithms.
+ * - Compile and run the code locally for personal testing.
+ *
+ * 4. NO WARRANTY:
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
+ *
+ * ======================================================================================
+ */
+
+/* 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 <stdio.h>
+
+int array_sum(int[], int);
+void get_data(int[], int);
+void display(int[], int);
+
+int main()
+{
+ int size, arr[20];
+ printf("How many element do you want to add (Max: 20): ");
+ scanf("%d", &size);
+ if (size < 1 && size > 20)
+ {
+ printf("\nMax Element count is 20.");
+ return 1;
+ }
+ get_data(arr, size);
+ display(arr, size);
+ printf("\nSum of the elements is: %d", array_sum(arr, size));
+ return 0;
+}
+
+void get_data(int a[], int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ printf("Enter element for position %d: ", i);
+ scanf("%d", &a[i]);
+ }
+}
+
+void display(int a[], int n)
+{
+ int i;
+ printf("\nArray: [");
+ for (i = 0; i < n; i++)
+ {
+ printf("%d", a[i]);
+ if (i != n - 1)
+ printf(", ");
+ }
+ printf("]\n");
+}
+
+int array_sum(int a[], int n)
+{
+ int i, sum = 0;
+ for (i = 0; i < n; i++)
+ sum += a[i];
+ return sum;
+}</div>
</div>
</div>
@@ -3565,7 +20087,7 @@
</div>
</div>
<div class="flex items-center gap-1 sm:gap-2 shrink-0">
- <!-- Share/Copy Button -->
+ <!-- Share Button -->
<button
id="share-btn"
class="p-2 text-slate-400 hover:text-white hover:bg-slate-700/50 rounded-lg transition-all group relative"
@@ -3602,6 +20124,46 @@
/>
</svg>
</button>
+
+ <!-- Copy Code Button -->
+ <button
+ id="copy-code-btn"
+ class="p-2 text-slate-400 hover:text-white hover:bg-slate-700/50 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-green-400 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>
+
+ <!-- View on GitHub Button -->
<a
id="modal-raw-link"
href="#"
@@ -3616,10 +20178,9 @@
viewBox="0 0 24 24"
>
<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"
+ fill-rule="evenodd"
+ d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
+ clip-rule="evenodd"
></path>
</svg>
</a>
@@ -3649,7 +20210,7 @@
<!-- Loading State -->
<div
id="code-loading"
- class="absolute inset-0 flex items-center justify-center z-10 bg-[#0d1117]"
+ 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-blue-500"
@@ -3774,70 +20335,33 @@
<script>
function toggleFolder(header) {
- // We handle two cases:
- // 1. onclick="toggleFolder(event)" (Modern, if you update python script)
- // 2. onclick="toggleFolder('folder-name')" (Legacy/Current python script behavior)
-
- let headerEl = null;
-
+ // Handle both Event objects (from onclick="toggleFolder(event)")
+ // and Element objects (from onclick="toggleFolder(this)")
if (header instanceof Event) {
- headerEl = header.currentTarget;
- } else if (header instanceof Element) {
- headerEl = header;
- } else if (typeof header === 'string') {
- // Legacy Case: header is an ID string like "assignment-primary"
- // The button element usually has an ID or we can find it relative to the structure
- // Assuming the python script generates: <button ... onclick="toggleFolder('id')">
- // In that case, 'this' context in inline onclick refers to window, but we need the element.
- // However, inline onclick="toggleFolder('id')" doesn't pass 'this'.
-
- // Fix strategy: Look for the element with the ID passed, OR look for the event target if available.
- // Since we can't easily get 'this' if it wasn't passed, we'll try to find the button that has this onclick.
- // A more robust way in legacy code without changing Python is to look for the element by ID if the folder container has that ID.
-
- // Let's try to find the element by ID if possible (assuming folder header might have ID)
- // If that fails, we use the global event object (deprecated but works in most browsers for inline handlers)
-
- if (window.event && window.event.currentTarget) {
- headerEl = window.event.currentTarget;
- } else {
- console.warn("toggleFolder: Could not determine clicked element from string argument. Trying ID lookup.");
- // Fallback: If your python script assigns IDs to the header divs matching the folder name
- headerEl = document.getElementById(header);
- }
+ header = header.currentTarget;
}
// Sanity Check
- if (!headerEl || typeof headerEl.querySelector !== 'function') {
- console.error("toggleFolder Error: Could not resolve header element.", header);
+ if (!header || typeof header.querySelector !== 'function') {
+ console.error("toggleFolder Error: Invalid header argument.", header);
return;
}
- const content = headerEl.nextElementSibling;
- const icon = headerEl.querySelector(".chevron");
- const folderIcon = headerEl.querySelector(".folder-icon");
-
- if (!content) {
- console.error("toggleFolder Error: Content sibling not found.");
- return;
- }
+ const content = header.nextElementSibling;
+ const icon = header.querySelector(".chevron");
+ const folderIcon = header.querySelector(".folder-icon");
// Toggle hidden class
content.classList.toggle("hidden");
-
- if (icon) {
- icon.classList.toggle("rotated");
- }
+ icon.classList.toggle("rotated");
- if (folderIcon) {
- // Optional: Change folder icon (open/closed)
- if (content.classList.contains("hidden")) {
- // Closed folder
- 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 {
- // Open folder (visual enhancement)
- 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>`;
- }
+ // Optional: Change folder icon (open/closed)
+ if (content.classList.contains("hidden")) {
+ // Closed folder
+ 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 {
+ // Open folder (visual enhancement)
+ 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>`;
}
}
@@ -3848,13 +20372,12 @@
const modalRawLink = document.getElementById("modal-raw-link");
const loadingSpinner = document.getElementById("code-loading");
- // We'll store the current file URL for sharing
let currentFileUrl = "";
- function showCode(fileUrl, filename, rawUrl) {
- currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename); // Construct shareable URL
+ // MODIFIED: Fetch from hidden ID instead of Network URL
+ function showCode(storageId, filename, rawUrl) {
+ currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename);
modal.classList.remove("hidden");
- // Trigger reflow for animation
void modal.offsetWidth;
modal.classList.remove("opacity-0");
modal.querySelector("div").classList.remove("scale-95");
@@ -3867,30 +20390,25 @@
const shareIconSuccess = document.getElementById("share-icon-success");
shareIconDefault.classList.remove("hidden", "scale-0");
shareIconSuccess.classList.add("hidden", "scale-0");
+
+ // Reset Copy Button State
+ const copyIconDefault = document.getElementById("copy-icon-default");
+ const copyIconSuccess = document.getElementById("copy-icon-success");
+ copyIconDefault.classList.remove("hidden", "scale-0");
+ copyIconSuccess.classList.add("hidden", "scale-0");
- // Show loading
- loadingSpinner.classList.remove("hidden");
- modalCodeBlock.textContent = ""; // Clear previous content
-
- // Fetch the code content
- fetch(rawUrl)
- .then((response) => {
- if (!response.ok) throw new Error("Network response was not ok");
- return response.text();
- })
- .then((text) => {
- modalCodeBlock.textContent = text;
- // Apply syntax highlighting
- delete modalCodeBlock.dataset.highlighted; // Clear highlighted state
- hljs.highlightElement(modalCodeBlock);
- loadingSpinner.classList.add("hidden");
- })
- .catch((err) => {
- modalCodeBlock.textContent = "Error loading code: " + err.message;
- loadingSpinner.classList.add("hidden");
- });
+ // LOAD FROM HIDDEN ELEMENT
+ const storedContent = document.getElementById(storageId);
+
+ if (storedContent) {
+ modalCodeBlock.innerHTML = storedContent.innerHTML;
+ delete modalCodeBlock.dataset.highlighted;
+ hljs.highlightElement(modalCodeBlock);
+ } else {
+ modalCodeBlock.textContent = "Error: Code content not found in page.";
+ }
- // Update URL history without reloading
+ // Update URL history
const newUrl = new URL(window.location);
newUrl.searchParams.set('file', filename);
window.history.pushState({ path: newUrl.href }, '', newUrl.href);
@@ -3900,13 +20418,11 @@
modal.classList.add("opacity-0");
modal.querySelector("div").classList.add("scale-95");
- // Wait for animation to finish before hiding display
setTimeout(() => {
modal.classList.add("hidden");
modalCodeBlock.textContent = "";
}, 200);
- // Clear URL param
const newUrl = new URL(window.location);
newUrl.searchParams.delete('file');
window.history.pushState({ path: newUrl.href }, '', newUrl.href);
@@ -3917,7 +20433,6 @@
function showLicense() {
licenseModal.classList.remove("hidden");
- // Trigger reflow for animation
void licenseModal.offsetWidth;
licenseModal.classList.remove("opacity-0");
licenseModal.querySelector("div").classList.remove("scale-95");
@@ -3931,7 +20446,6 @@
}, 200);
}
- // Close license modal on escape or click outside
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && !licenseModal.classList.contains("hidden")) {
hideLicense();
@@ -3945,19 +20459,14 @@
});
/* --- Search Logic --- */
- // Use a debounced search for better performance if list is huge
- let searchIndex = []; // Will store { name: "filename", element: DOMElement, parent: FolderDOMElement }
+ let searchIndex = [];
function buildSearchIndex() {
searchIndex = [];
const fileElements = document.querySelectorAll(".file-item");
fileElements.forEach((el) => {
- const name = el
- .querySelector("span")
- .textContent.toLowerCase()
- .trim();
- // Find parent folder content div to open it if match found
- const parentContent = el.closest(".pl-4"); // based on structure
+ const name = el.querySelector("span").textContent.toLowerCase().trim();
+ const parentContent = el.closest(".pl-4");
searchIndex.push({ name, element: el, parent: parentContent });
});
}
@@ -3965,61 +20474,40 @@
const searchInput = document.getElementById("search-input");
searchInput.addEventListener("input", (e) => {
const query = e.target.value.toLowerCase();
-
- // If index empty (lazy load), build it
if (searchIndex.length === 0) buildSearchIndex();
- // If query is empty, show everything
if (!query) {
document.querySelectorAll('.file-item, .folder-container').forEach(el => el.classList.remove('hidden'));
- // Re-close folders that were originally closed?
- // Simplest: Just collapse all folders or keep current state.
- // For now, let's just make sure files are visible.
return;
}
- // Hide all first
- // actually, hiding everything and showing matches is cleaner
document.querySelectorAll('.file-item').forEach(el => el.classList.add('hidden'));
document.querySelectorAll('.folder-container').forEach(el => el.classList.add('hidden'));
- let hasResults = false;
-
searchIndex.forEach(item => {
if (item.name.includes(query)) {
- // Show file
item.element.classList.remove('hidden');
- // Show parent folder container
- // This logic is a bit tricky with nested folders.
- // We need to walk up the DOM to show all parent folders.
let parent = item.element.parentElement;
while(parent && parent.id !== "file-list-container") {
- parent.classList.remove('hidden'); // Show content div
+ parent.classList.remove('hidden');
if (parent.previousElementSibling) {
- // This is the folder header (button)
- // Make sure the folder container wrapping both is visible
const folderContainer = parent.parentElement;
if(folderContainer.classList.contains('folder-container')) {
folderContainer.classList.remove('hidden');
}
- // Expand the folder visually
if(parent.classList.contains('hidden')) {
- // this check is redundant due to line above, but for clarity:
- // we removed hidden above. Now rotate chevron.
const chevron = parent.previousElementSibling.querySelector('.chevron');
if(chevron && !chevron.classList.contains('rotated')) {
chevron.classList.add('rotated');
}
- // Update folder icon to open
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;
}
- hasResults = true;
}
});
});
@@ -4036,23 +20524,14 @@
}
document.addEventListener("DOMContentLoaded", () => {
- // Check URL params for shared file
const params = new URLSearchParams(window.location.search);
const sharedFile = params.get('file');
if (sharedFile) {
- // Find the file element to get the raw URL
- // We need to wait for the injection.
- // Since injection happens on server/build time, DOM is ready.
- // We just need to find the link.
- // We can search the DOM for a file-item with matching text.
const fileElements = document.querySelectorAll(".file-item");
for (let el of fileElements) {
const name = el.querySelector("span").textContent.trim();
if (name === sharedFile) {
- // Simulate click or manually call showCode
const onClickAttr = el.getAttribute('onclick');
- // Extract args from onclick string: showCode('url', 'name', 'raw')
- // Regex or simple parsing
const match = onClickAttr.match(/showCode\('([^']*)',\s*'([^']*)',\s*'([^']*)'\)/);
if (match) {
showCode(match[1], match[2], match[3]);
@@ -4089,24 +20568,32 @@
});
}
});
+
+ /* --- Copy Code Functionality --- */
+ 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 = modalCodeBlock.innerText;
+ 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");
-
- // 1. ESCAPE key closes modal
if (e.key === "Escape" && !modal.classList.contains("hidden")) {
hideCode();
return;
}
-
- // 2. '/' key focuses search bar
- // Check if the key is '/', the modal is not open, and the current focus is not an input field
if (
e.key === "/" &&
modal.classList.contains("hidden") &&
!/^(INPUT|TEXTAREA|SELECT)$/i.test(document.activeElement.tagName)
) {
- // Prevent the '/' character from being typed outside the input field
e.preventDefault();
searchInput.focus();
}
diff --git a/docs/template.html b/docs/template.html
@@ -3,6 +3,8 @@
<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>
<script src="https://cdn.tailwindcss.com"></script>
<link
@@ -125,7 +127,7 @@
</p>
</div>
</div>
- <!-- Mobile: Github Icon (Visible only on small screens to save space in row 2) -->
+ <!-- Mobile: Github Icon -->
<a href="https://github.com/notamitgamer/bsc" target="_blank" class="sm:hidden text-slate-600 hover:text-slate-900">
<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>
@@ -172,16 +174,8 @@
class="hidden sm:flex bg-slate-900 hover:bg-slate-800 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all shadow-sm items-center gap-2"
>
<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 class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
+ <path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path>
</svg>
</a>
</div>
@@ -226,7 +220,7 @@
</div>
</div>
<div class="flex items-center gap-1 sm:gap-2 shrink-0">
- <!-- Share/Copy Button -->
+ <!-- Share Button -->
<button
id="share-btn"
class="p-2 text-slate-400 hover:text-white hover:bg-slate-700/50 rounded-lg transition-all group relative"
@@ -263,6 +257,46 @@
/>
</svg>
</button>
+
+ <!-- Copy Code Button -->
+ <button
+ id="copy-code-btn"
+ class="p-2 text-slate-400 hover:text-white hover:bg-slate-700/50 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-green-400 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>
+
+ <!-- View on GitHub Button -->
<a
id="modal-raw-link"
href="#"
@@ -277,10 +311,9 @@
viewBox="0 0 24 24"
>
<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"
+ fill-rule="evenodd"
+ d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
+ clip-rule="evenodd"
></path>
</svg>
</a>
@@ -310,7 +343,7 @@
<!-- Loading State -->
<div
id="code-loading"
- class="absolute inset-0 flex items-center justify-center z-10 bg-[#0d1117]"
+ 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-blue-500"
@@ -435,70 +468,33 @@
<script>
function toggleFolder(header) {
- // We handle two cases:
- // 1. onclick="toggleFolder(event)" (Modern, if you update python script)
- // 2. onclick="toggleFolder('folder-name')" (Legacy/Current python script behavior)
-
- let headerEl = null;
-
+ // Handle both Event objects (from onclick="toggleFolder(event)")
+ // and Element objects (from onclick="toggleFolder(this)")
if (header instanceof Event) {
- headerEl = header.currentTarget;
- } else if (header instanceof Element) {
- headerEl = header;
- } else if (typeof header === 'string') {
- // Legacy Case: header is an ID string like "assignment-primary"
- // The button element usually has an ID or we can find it relative to the structure
- // Assuming the python script generates: <button ... onclick="toggleFolder('id')">
- // In that case, 'this' context in inline onclick refers to window, but we need the element.
- // However, inline onclick="toggleFolder('id')" doesn't pass 'this'.
-
- // Fix strategy: Look for the element with the ID passed, OR look for the event target if available.
- // Since we can't easily get 'this' if it wasn't passed, we'll try to find the button that has this onclick.
- // A more robust way in legacy code without changing Python is to look for the element by ID if the folder container has that ID.
-
- // Let's try to find the element by ID if possible (assuming folder header might have ID)
- // If that fails, we use the global event object (deprecated but works in most browsers for inline handlers)
-
- if (window.event && window.event.currentTarget) {
- headerEl = window.event.currentTarget;
- } else {
- console.warn("toggleFolder: Could not determine clicked element from string argument. Trying ID lookup.");
- // Fallback: If your python script assigns IDs to the header divs matching the folder name
- headerEl = document.getElementById(header);
- }
+ header = header.currentTarget;
}
// Sanity Check
- if (!headerEl || typeof headerEl.querySelector !== 'function') {
- console.error("toggleFolder Error: Could not resolve header element.", header);
+ if (!header || typeof header.querySelector !== 'function') {
+ console.error("toggleFolder Error: Invalid header argument.", header);
return;
}
- const content = headerEl.nextElementSibling;
- const icon = headerEl.querySelector(".chevron");
- const folderIcon = headerEl.querySelector(".folder-icon");
-
- if (!content) {
- console.error("toggleFolder Error: Content sibling not found.");
- return;
- }
+ const content = header.nextElementSibling;
+ const icon = header.querySelector(".chevron");
+ const folderIcon = header.querySelector(".folder-icon");
// Toggle hidden class
content.classList.toggle("hidden");
-
- if (icon) {
- icon.classList.toggle("rotated");
- }
-
- if (folderIcon) {
- // Optional: Change folder icon (open/closed)
- if (content.classList.contains("hidden")) {
- // Closed folder
- 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 {
- // Open folder (visual enhancement)
- 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>`;
- }
+ icon.classList.toggle("rotated");
+
+ // Optional: Change folder icon (open/closed)
+ if (content.classList.contains("hidden")) {
+ // Closed folder
+ 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 {
+ // Open folder (visual enhancement)
+ 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>`;
}
}
@@ -509,13 +505,12 @@
const modalRawLink = document.getElementById("modal-raw-link");
const loadingSpinner = document.getElementById("code-loading");
- // We'll store the current file URL for sharing
let currentFileUrl = "";
- function showCode(fileUrl, filename, rawUrl) {
- currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename); // Construct shareable URL
+ // MODIFIED: Fetch from hidden ID instead of Network URL
+ function showCode(storageId, filename, rawUrl) {
+ currentFileUrl = window.location.href.split("?")[0] + "?file=" + encodeURIComponent(filename);
modal.classList.remove("hidden");
- // Trigger reflow for animation
void modal.offsetWidth;
modal.classList.remove("opacity-0");
modal.querySelector("div").classList.remove("scale-95");
@@ -528,30 +523,25 @@
const shareIconSuccess = document.getElementById("share-icon-success");
shareIconDefault.classList.remove("hidden", "scale-0");
shareIconSuccess.classList.add("hidden", "scale-0");
-
- // Show loading
- loadingSpinner.classList.remove("hidden");
- modalCodeBlock.textContent = ""; // Clear previous content
-
- // Fetch the code content
- fetch(rawUrl)
- .then((response) => {
- if (!response.ok) throw new Error("Network response was not ok");
- return response.text();
- })
- .then((text) => {
- modalCodeBlock.textContent = text;
- // Apply syntax highlighting
- delete modalCodeBlock.dataset.highlighted; // Clear highlighted state
- hljs.highlightElement(modalCodeBlock);
- loadingSpinner.classList.add("hidden");
- })
- .catch((err) => {
- modalCodeBlock.textContent = "Error loading code: " + err.message;
- loadingSpinner.classList.add("hidden");
- });
+
+ // Reset Copy Button State
+ const copyIconDefault = document.getElementById("copy-icon-default");
+ const copyIconSuccess = document.getElementById("copy-icon-success");
+ copyIconDefault.classList.remove("hidden", "scale-0");
+ copyIconSuccess.classList.add("hidden", "scale-0");
+
+ // LOAD FROM HIDDEN ELEMENT
+ const storedContent = document.getElementById(storageId);
+
+ if (storedContent) {
+ modalCodeBlock.innerHTML = storedContent.innerHTML;
+ delete modalCodeBlock.dataset.highlighted;
+ hljs.highlightElement(modalCodeBlock);
+ } else {
+ modalCodeBlock.textContent = "Error: Code content not found in page.";
+ }
- // Update URL history without reloading
+ // Update URL history
const newUrl = new URL(window.location);
newUrl.searchParams.set('file', filename);
window.history.pushState({ path: newUrl.href }, '', newUrl.href);
@@ -561,13 +551,11 @@
modal.classList.add("opacity-0");
modal.querySelector("div").classList.add("scale-95");
- // Wait for animation to finish before hiding display
setTimeout(() => {
modal.classList.add("hidden");
modalCodeBlock.textContent = "";
}, 200);
- // Clear URL param
const newUrl = new URL(window.location);
newUrl.searchParams.delete('file');
window.history.pushState({ path: newUrl.href }, '', newUrl.href);
@@ -578,7 +566,6 @@
function showLicense() {
licenseModal.classList.remove("hidden");
- // Trigger reflow for animation
void licenseModal.offsetWidth;
licenseModal.classList.remove("opacity-0");
licenseModal.querySelector("div").classList.remove("scale-95");
@@ -592,7 +579,6 @@
}, 200);
}
- // Close license modal on escape or click outside
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && !licenseModal.classList.contains("hidden")) {
hideLicense();
@@ -606,19 +592,14 @@
});
/* --- Search Logic --- */
- // Use a debounced search for better performance if list is huge
- let searchIndex = []; // Will store { name: "filename", element: DOMElement, parent: FolderDOMElement }
+ let searchIndex = [];
function buildSearchIndex() {
searchIndex = [];
const fileElements = document.querySelectorAll(".file-item");
fileElements.forEach((el) => {
- const name = el
- .querySelector("span")
- .textContent.toLowerCase()
- .trim();
- // Find parent folder content div to open it if match found
- const parentContent = el.closest(".pl-4"); // based on structure
+ const name = el.querySelector("span").textContent.toLowerCase().trim();
+ const parentContent = el.closest(".pl-4");
searchIndex.push({ name, element: el, parent: parentContent });
});
}
@@ -626,61 +607,40 @@
const searchInput = document.getElementById("search-input");
searchInput.addEventListener("input", (e) => {
const query = e.target.value.toLowerCase();
-
- // If index empty (lazy load), build it
if (searchIndex.length === 0) buildSearchIndex();
- // If query is empty, show everything
if (!query) {
document.querySelectorAll('.file-item, .folder-container').forEach(el => el.classList.remove('hidden'));
- // Re-close folders that were originally closed?
- // Simplest: Just collapse all folders or keep current state.
- // For now, let's just make sure files are visible.
return;
}
- // Hide all first
- // actually, hiding everything and showing matches is cleaner
document.querySelectorAll('.file-item').forEach(el => el.classList.add('hidden'));
document.querySelectorAll('.folder-container').forEach(el => el.classList.add('hidden'));
- let hasResults = false;
-
searchIndex.forEach(item => {
if (item.name.includes(query)) {
- // Show file
item.element.classList.remove('hidden');
- // Show parent folder container
- // This logic is a bit tricky with nested folders.
- // We need to walk up the DOM to show all parent folders.
let parent = item.element.parentElement;
while(parent && parent.id !== "file-list-container") {
- parent.classList.remove('hidden'); // Show content div
+ parent.classList.remove('hidden');
if (parent.previousElementSibling) {
- // This is the folder header (button)
- // Make sure the folder container wrapping both is visible
const folderContainer = parent.parentElement;
if(folderContainer.classList.contains('folder-container')) {
folderContainer.classList.remove('hidden');
}
- // Expand the folder visually
if(parent.classList.contains('hidden')) {
- // this check is redundant due to line above, but for clarity:
- // we removed hidden above. Now rotate chevron.
const chevron = parent.previousElementSibling.querySelector('.chevron');
if(chevron && !chevron.classList.contains('rotated')) {
chevron.classList.add('rotated');
}
- // Update folder icon to open
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;
}
- hasResults = true;
}
});
});
@@ -697,23 +657,14 @@
}
document.addEventListener("DOMContentLoaded", () => {
- // Check URL params for shared file
const params = new URLSearchParams(window.location.search);
const sharedFile = params.get('file');
if (sharedFile) {
- // Find the file element to get the raw URL
- // We need to wait for the injection.
- // Since injection happens on server/build time, DOM is ready.
- // We just need to find the link.
- // We can search the DOM for a file-item with matching text.
const fileElements = document.querySelectorAll(".file-item");
for (let el of fileElements) {
const name = el.querySelector("span").textContent.trim();
if (name === sharedFile) {
- // Simulate click or manually call showCode
const onClickAttr = el.getAttribute('onclick');
- // Extract args from onclick string: showCode('url', 'name', 'raw')
- // Regex or simple parsing
const match = onClickAttr.match(/showCode\('([^']*)',\s*'([^']*)',\s*'([^']*)'\)/);
if (match) {
showCode(match[1], match[2], match[3]);
@@ -750,24 +701,32 @@
});
}
});
+
+ /* --- Copy Code Functionality --- */
+ 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 = modalCodeBlock.innerText;
+ 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");
-
- // 1. ESCAPE key closes modal
if (e.key === "Escape" && !modal.classList.contains("hidden")) {
hideCode();
return;
}
-
- // 2. '/' key focuses search bar
- // Check if the key is '/', the modal is not open, and the current focus is not an input field
if (
e.key === "/" &&
modal.classList.contains("hidden") &&
!/^(INPUT|TEXTAREA|SELECT)$/i.test(document.activeElement.tagName)
) {
- // Prevent the '/' character from being typed outside the input field
e.preventDefault();
searchInput.focus();
}