commit d40160f89af76a698669f4aa1baaaab184cf31cc
parent e56776ce0f05704234e5934726192291ffa47440
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sun, 18 Jan 2026 14:20:28 +0530
[2026-01-18] : .\Semester_1\assignment-secondary : added some more files
Diffstat:
4 files changed, 212 insertions(+), 0 deletions(-)
diff --git a/Semester_1/assignment-secondary/assignment-s-22.c b/Semester_1/assignment-secondary/assignment-s-22.c
@@ -0,0 +1,46 @@
+/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * Repository : https://github.com/notamitgamer/bsc
+ * License : ESAL-1.0 ( https://esal.amit.is-a.dev )
+ * ======================================================================================
+ * [ ACADEMIC INTEGRITY WARNING ]
+ * The use of this code for academic assignments at ANY educational institution,
+ * college, or university is STRICTLY PROHIBITED.
+ * Any other use requires prior written permission from the author.
+ * Violations will be reported as academic misconduct.
+ * ======================================================================================
+ */
+
+/* Write a program using structures to add two distances in meter-kilometer format. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+struct distance
+{
+ int km;
+ int m;
+};
+
+void total_distance(struct distance[]);
+
+int main()
+{
+ struct distance dis[2] = {0};
+ printf("Enter the 1st distance (KM M): ");
+ scanf("%d %d", &dis[0].km, &dis[0].m);
+ printf("Enter the 2nd distance: ");
+ scanf("%d %d", &dis[1].km, &dis[1].m);
+ total_distance(dis);
+ return 0;
+}
+
+void total_distance(struct distance dis[])
+{
+ int result_km = dis[0].km + dis[1].km;
+ int result_m = dis[0].m + dis[1].m;
+ result_km += result_m / 1000;
+ result_m = result_m % 1000;
+ printf("Total distance: %d KM, %d M", result_km, result_m);
+}+
\ No newline at end of file
diff --git a/Semester_1/assignment-secondary/assignment-s-23.c b/Semester_1/assignment-secondary/assignment-s-23.c
@@ -0,0 +1,36 @@
+/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * Repository : https://github.com/notamitgamer/bsc
+ * License : ESAL-1.0 ( https://esal.amit.is-a.dev )
+ * ======================================================================================
+ * [ ACADEMIC INTEGRITY WARNING ]
+ * The use of this code for academic assignments at ANY educational institution,
+ * college, or university is STRICTLY PROHIBITED.
+ * Any other use requires prior written permission from the author.
+ * Violations will be reported as academic misconduct.
+ * ======================================================================================
+ */
+
+/* Write a program to add two complex numbers using structures. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+struct complex_number
+{
+ double real;
+ double imaginary;
+};
+
+int main()
+{
+ struct complex_number a, b;
+ printf("Enter the 1st complex number in this format (a+bi): ");
+ scanf("%lf+%lfi", &a.real, &a.imaginary);
+ printf("Enter the 2nd complex number in this format (a+bi): ");
+ scanf("%lf+%lfi", &b.real, &b.imaginary);
+
+ printf("Result = %-2g + %-2.2g", a.real + b.real, a.imaginary + b.imaginary);
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/assignment-secondary/assignment-s-24.c b/Semester_1/assignment-secondary/assignment-s-24.c
diff --git a/docs/index.html b/docs/index.html
@@ -3624,6 +3624,134 @@ void transpose(int **matrix, int rows, int cols)
}</div>
</div>
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-22-c', 'assignment-s-22.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-22.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-22.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-assignment-secondary-assignment-s-22-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * Repository : https://github.com/notamitgamer/bsc
+ * License : ESAL-1.0 ( https://esal.amit.is-a.dev )
+ * ======================================================================================
+ * [ ACADEMIC INTEGRITY WARNING ]
+ * The use of this code for academic assignments at ANY educational institution,
+ * college, or university is STRICTLY PROHIBITED.
+ * Any other use requires prior written permission from the author.
+ * Violations will be reported as academic misconduct.
+ * ======================================================================================
+ */
+
+/* Write a program using structures to add two distances in meter-kilometer format. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+struct distance
+{
+ int km;
+ int m;
+};
+
+void total_distance(struct distance[]);
+
+int main()
+{
+ struct distance dis[2] = {0};
+ printf("Enter the 1st distance (KM M): ");
+ scanf("%d %d", &dis[0].km, &dis[0].m);
+ printf("Enter the 2nd distance: ");
+ scanf("%d %d", &dis[1].km, &dis[1].m);
+ total_distance(dis);
+ return 0;
+}
+
+void total_distance(struct distance dis[])
+{
+ int result_km = dis[0].km + dis[1].km;
+ int result_m = dis[0].m + dis[1].m;
+ result_km += result_m / 1000;
+ result_m = result_m % 1000;
+ printf("Total distance: %d KM, %d M", result_km, result_m);
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-23-c', 'assignment-s-23.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-23.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-23.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-assignment-secondary-assignment-s-23-c" style="display:none;">/*
+ * ======================================================================================
+ * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED.
+ * Repository : https://github.com/notamitgamer/bsc
+ * License : ESAL-1.0 ( https://esal.amit.is-a.dev )
+ * ======================================================================================
+ * [ ACADEMIC INTEGRITY WARNING ]
+ * The use of this code for academic assignments at ANY educational institution,
+ * college, or university is STRICTLY PROHIBITED.
+ * Any other use requires prior written permission from the author.
+ * Violations will be reported as academic misconduct.
+ * ======================================================================================
+ */
+
+/* Write a program to add two complex numbers using structures. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+struct complex_number
+{
+ double real;
+ double imaginary;
+};
+
+int main()
+{
+ struct complex_number a, b;
+ printf("Enter the 1st complex number in this format (a+bi): ");
+ scanf("%lf+%lfi", &a.real, &a.imaginary);
+ printf("Enter the 2nd complex number in this format (a+bi): ");
+ scanf("%lf+%lfi", &b.real, &b.imaginary);
+
+ printf("Result = %-2g + %-2.2g", a.real + b.real, a.imaginary + b.imaginary);
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-assignment-secondary-assignment-s-24-c', 'assignment-s-24.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">assignment-s-24.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/assignment-secondary/assignment-s-24.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-assignment-secondary-assignment-s-24-c" style="display:none;"></div>
+ </div>
+
</div>
</div>