commit 1260ee98e952d19e3cb5996569873d6da01f9f60
parent ac861c73e764c1adba12ad158518dd9db72c7dff
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sun, 8 Feb 2026 15:50:35 +0530
[2026-02-08] : .\Semester_1\letusc : Automated Update: Source code for Chapter 10, 12, 13, 14, 15, 16
Diffstat:
31 files changed, 3886 insertions(+), 0 deletions(-)
diff --git a/Semester_1/letusc/interest.h b/Semester_1/letusc/interest.h
@@ -0,0 +1,7 @@
+/*
+ * Author : Amit Dutta
+ * File : interest.h
+ */
+
+#define SIMPLE_INTEREST(p, r, t) ((p * r * t) / 100.0)
+#define AMOUNT(p, si) (p + si)
diff --git a/Semester_1/letusc/luc049.c b/Semester_1/letusc/luc049.c
@@ -0,0 +1,61 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* A positive integer is entered through the keyboard, write a function to find the binary equivalent of this number:
+(1) Without using recursion
+(2) Using recursion
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(a) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int binary_non_rec(int);
+void binary_rec(int);
+
+int main()
+{
+ int num, bin;
+
+ printf("Enter a positive integer: ");
+ scanf("%d", &num);
+
+ bin = binary_non_rec(num);
+ printf("Binary (Non-Recursive): %d\n", bin);
+
+ printf("Binary (Recursive): ");
+ binary_rec(num);
+ printf("\n");
+
+ return 0;
+}
+
+int binary_non_rec(int n)
+{
+ int rem, i = 1, bin = 0;
+ while (n != 0)
+ {
+ rem = n % 2;
+ n = n / 2;
+ bin = bin + rem * i;
+ i = i * 10;
+ }
+ return bin;
+}
+
+void binary_rec(int n)
+{
+ if (n > 1)
+ binary_rec(n / 2);
+
+ printf("%d", n % 2);
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc050.c b/Semester_1/letusc/luc050.c
@@ -0,0 +1,38 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a recursive function to obtain the sum of first 25 natural numbers.
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(b) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int get_sum(int);
+
+int main()
+{
+ int n = 25, sum;
+
+ sum = get_sum(n);
+ printf("Sum of first %d natural numbers is: %d\n", n, sum);
+
+ return 0;
+}
+
+int get_sum(int n)
+{
+ if (n == 0)
+ return 0;
+ else
+ return n + get_sum(n - 1);
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc051.c b/Semester_1/letusc/luc051.c
@@ -0,0 +1,42 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Tower of Hanoi: Write a program to print out the sequence in which 4 disks should be moved from peg A to peg C using peg B.
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(c) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void hanoi(int, char, char, char);
+
+int main()
+{
+ int n = 4;
+
+ printf("Sequence of moves for %d disks:\n\n", n);
+ hanoi(n, 'A', 'B', 'C');
+
+ return 0;
+}
+
+void hanoi(int n, char from_rod, char aux_rod, char to_rod)
+{
+ if (n == 1)
+ {
+ printf("Move disk 1 from rod %c to rod %c\n", from_rod, to_rod);
+ return;
+ }
+ hanoi(n - 1, from_rod, to_rod, aux_rod);
+ printf("Move disk %d from rod %c to rod %c\n", n, from_rod, to_rod);
+ hanoi(n - 1, aux_rod, from_rod, to_rod);
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc052.c b/Semester_1/letusc/luc052.c
@@ -0,0 +1,27 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If a macro is not getting expanded as per your expectation, how will you find out how is it being expanded by the preprocessor?
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(a) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ printf("To see how macros are expanded, use the compiler flag '-E'.\n");
+ printf("Command: gcc -E filename.c\n");
+ printf("This outputs the file after preprocessing stage.\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc053.c b/Semester_1/letusc/luc053.c
@@ -0,0 +1,47 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write macro definitions for: Mean, Absolute value, Uppercase to Lowercase, Biggest of three.
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(b) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define MEAN(x, y) ((x + y) / 2.0)
+#define ABS(x) ((x) < 0 ? -(x) : (x))
+#define TO_LOWER(x) ((x) >= 'A' && (x) <= 'Z' ? (x) + 32 : (x))
+#define MAX(x, y, z) ((x) > (y) ? ((x) > (z) ? (x) : (z)) : ((y) > (z) ? (y) : (z)))
+
+int main()
+{
+ int a, b, c, num;
+ char ch;
+
+ printf("Enter two numbers for Mean: ");
+ scanf("%d %d", &a, &b);
+ printf("Mean: %.2f\n\n", MEAN(a, b));
+
+ printf("Enter a number for Absolute value: ");
+ scanf("%d", &num);
+ printf("Absolute: %d\n\n", ABS(num));
+
+ printf("Enter an uppercase character: ");
+ scanf(" %c", &ch);
+ printf("Lowercase: %c\n\n", TO_LOWER(ch));
+
+ printf("Enter three numbers: ");
+ scanf("%d %d %d", &a, &b, &c);
+ printf("Biggest: %d\n", MAX(a, b, c));
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc054.c b/Semester_1/letusc/luc054.c
@@ -0,0 +1,36 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Use 'interest.h' macros to calculate Simple Interest and Amount.
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(c) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#include "interest.h"
+
+int main()
+{
+ float p, r, t, si, amt;
+
+ printf("Enter Principal, Rate and Time: ");
+ scanf("%f %f %f", &p, &r, &t);
+
+ si = SIMPLE_INTEREST(p, r, t);
+ amt = AMOUNT(p, si);
+
+ printf("Simple Interest: %.2f\n", si);
+ printf("Total Amount: %.2f\n", amt);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc055.c b/Semester_1/letusc/luc055.c
@@ -0,0 +1,50 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how many are negative, how many are even and how many odd.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[25], i;
+ int pos = 0, neg = 0, even = 0, odd = 0;
+
+ printf("Enter 25 integers:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+
+ if (arr[i] > 0)
+ pos++;
+ else if (arr[i] < 0)
+ neg++;
+
+ if (arr[i] % 2 == 0)
+ even++;
+ else
+ odd++;
+ }
+
+ printf("\nResults:\n");
+ printf("Positive: %d\n", pos);
+ printf("Negative: %d\n", neg);
+ printf("Even: %d\n", even);
+ printf("Odd: %d\n", odd);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc056.c b/Semester_1/letusc/luc056.c
@@ -0,0 +1,51 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If an array arr contains n elements, then write a program to check if arr[0] = arr[n-1], arr[1] = arr[n-2] and so on.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[100], n, i, symmetric = 1;
+
+ printf("Enter number of elements (n): ");
+ scanf("%d", &n);
+
+ printf("Enter %d elements: ", n);
+ for (i = 0; i < n; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ // Check symmetry
+ for (i = 0; i < n / 2; i++)
+ {
+ if (arr[i] != arr[n - 1 - i])
+ {
+ symmetric = 0;
+ break;
+ }
+ }
+
+ if (symmetric)
+ printf("\nThe array is symmetric (Palindrome).\n");
+ else
+ printf("\nThe array is NOT symmetric.\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc057.c b/Semester_1/letusc/luc057.c
@@ -0,0 +1,48 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program using pointers to find the smallest number in an array of 25 integers.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[25], i, min;
+ int *ptr;
+
+ printf("Enter 25 integers:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ ptr = arr; // Point to start of array
+ min = *ptr; // Initialize min with first element
+
+ for (i = 1; i < 25; i++)
+ {
+ ptr++; // Move pointer to next element
+ if (*ptr < min)
+ {
+ min = *ptr;
+ }
+ }
+
+ printf("\nSmallest number is: %d\n", min);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc058.c b/Semester_1/letusc/luc058.c
@@ -0,0 +1,63 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Implement the Insertion Sort algorithm shown in Figure 13.3 on a set of 25 numbers.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(d) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void insertion_sort(int *, int);
+
+int main()
+{
+ int arr[25], i;
+
+ printf("Enter 25 integers for Insertion Sort:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ insertion_sort(arr, 25);
+
+ printf("\nSorted Array:\n");
+ for (i = 0; i < 25; i++)
+ {
+ printf("%d ", arr[i]);
+ }
+ printf("\n");
+
+ return 0;
+}
+
+void insertion_sort(int *arr, int n)
+{
+ int i, j, key;
+ for (i = 1; i < n; i++)
+ {
+ key = arr[i];
+ j = i - 1;
+
+ /* Move elements of arr[0..i-1], that are greater than key,
+ to one position ahead of their current position */
+ while (j >= 0 && arr[j] > key)
+ {
+ arr[j + 1] = arr[j];
+ j = j - 1;
+ }
+ arr[j + 1] = key;
+ }
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc059.c b/Semester_1/letusc/luc059.c
@@ -0,0 +1,50 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program which initializes an integer array of 10 elements in main(), passes it to modify(), multiplies each element by 3, and prints the new array in main().
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void modify(int *, int);
+
+int main()
+{
+ int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ int i;
+
+ printf("Original Array:\n");
+ for (i = 0; i < 10; i++)
+ printf("%d ", arr[i]);
+
+ modify(arr, 10);
+
+ printf("\n\nModified Array (x3):\n");
+ for (i = 0; i < 10; i++)
+ printf("%d ", arr[i]);
+ printf("\n");
+
+ return 0;
+}
+
+void modify(int *a, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[i] = a[i] * 3;
+ }
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc060.c b/Semester_1/letusc/luc060.c
@@ -0,0 +1,47 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* For the following set of sample data, compute the standard deviation and the mean.\nData: -6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int data[] = {-6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2};
+ int n = 15, i;
+ double sum = 0.0, mean, std_dev = 0.0;
+
+ // Calculate Mean
+ for (i = 0; i < n; i++)
+ {
+ sum += data[i];
+ }
+ mean = sum / n;
+
+ // Calculate Standard Deviation
+ for (i = 0; i < n; i++)
+ {
+ std_dev += pow(data[i] - mean, 2);
+ }
+ std_dev = sqrt(std_dev / n);
+
+ printf("Count: %d\n", n);
+ printf("Mean: %.2f\n", mean);
+ printf("Standard Deviation: %.2f\n", std_dev);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc061.c b/Semester_1/letusc/luc061.c
@@ -0,0 +1,52 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* The area of a triangle can be computed by the sine law. Given 6 triangular pieces of land (a, b, angle), find their area and determine which is largest.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(g) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ // Data arrays
+ double a[] = {137.4, 155.2, 149.3, 160.0, 155.6, 149.7};
+ double b[] = {80.9, 92.62, 97.93, 100.25, 68.95, 120.0};
+ double angle[] = {0.78, 0.89, 1.35, 9.00, 1.25, 1.75}; // Assuming radians based on values < 2.0. 9.00 is treated as literal.
+
+ double area, max_area = 0.0;
+ int i, max_index = -1;
+
+ printf("Plot No.\tArea\n");
+ printf("------------------------\n");
+
+ for (i = 0; i < 6; i++)
+ {
+ // Area = 1/2 * a * b * sin(angle)
+ area = 0.5 * a[i] * b[i] * sin(angle[i]);
+
+ printf("%d\t\t%.2f\n", i + 1, area);
+
+ if (area > max_area)
+ {
+ max_area = area;
+ max_index = i + 1;
+ }
+ }
+
+ printf("\nLargest Plot is No. %d with Area: %.2f\n", max_index, max_area);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc062.c b/Semester_1/letusc/luc062.c
@@ -0,0 +1,51 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* For the following set of n data points (x, y), write a program to compute the correlation coefficient r.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(h) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ double x[] = {34.22, 39.87, 41.85, 43.23, 40.06, 53.29, 53.29, 54.14, 49.12, 40.71, 55.15};
+ double y[] = {102.43, 100.93, 97.43, 97.81, 98.32, 98.32, 100.07, 97.08, 91.59, 94.85, 94.65};
+
+ int n = 11, i;
+ double sum_x = 0, sum_y = 0, sum_xy = 0, sum_x2 = 0, sum_y2 = 0;
+ double numerator, denominator, r;
+
+ for (i = 0; i < n; i++)
+ {
+ sum_x += x[i];
+ sum_y += y[i];
+ sum_xy += x[i] * y[i];
+ sum_x2 += x[i] * x[i];
+ sum_y2 += y[i] * y[i];
+ }
+
+ numerator = (n * sum_xy) - (sum_x * sum_y);
+ denominator = sqrt((n * sum_x2 - sum_x * sum_x) * (n * sum_y2 - sum_y * sum_y));
+
+ if (denominator != 0)
+ r = numerator / denominator;
+ else
+ r = 0; // Avoid division by zero
+
+ printf("Correlation coefficient (r) = %.4f\n", r);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc063.c b/Semester_1/letusc/luc063.c
@@ -0,0 +1,46 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* The X and Y coordinates of 10 different points are entered through the keyboard. Write a program to find the distance of last point from the first point (sum of distances between consecutive points).
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(i) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ double x[10], y[10];
+ double total_distance = 0.0;
+ int i;
+
+ printf("Enter coordinates (x, y) for 10 points:\n");
+ for (i = 0; i < 10; i++)
+ {
+ printf("Point %d: ", i + 1);
+ scanf("%lf %lf", &x[i], &y[i]);
+ }
+
+ // Sum of distances between consecutive points P(i) and P(i+1)
+ for (i = 0; i < 9; i++)
+ {
+ double dx = x[i+1] - x[i];
+ double dy = y[i+1] - y[i];
+ total_distance += sqrt(dx*dx + dy*dy);
+ }
+
+ printf("\nTotal distance from first to last point: %.2f\n", total_distance);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc064.c b/Semester_1/letusc/luc064.c
@@ -0,0 +1,184 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Simulate a Dequeue (Double Ended Queue) using an array. Support: retrieve left, retrieve right, insert left, insert right. Use pointers left and right.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(j) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define MAX 10
+
+void insert_left(int *, int *, int *, int);
+void insert_right(int *, int *, int *, int);
+void retrieve_left(int *, int *, int *);
+void retrieve_right(int *, int *, int *);
+void display(int *, int, int);
+
+int main()
+{
+ int dq[MAX];
+ int left = -1, right = -1;
+ int choice, val;
+
+ while (1)
+ {
+ printf("\n--- Dequeue Menu ---\n");
+ printf("1. Insert Left\n2. Insert Right\n");
+ printf("3. Retrieve Left\n4. Retrieve Right\n");
+ printf("5. Display\n6. Exit\n");
+ printf("Enter choice: ");
+ scanf("%d", &choice);
+
+ switch (choice)
+ {
+ case 1:
+ printf("Enter value: ");
+ scanf("%d", &val);
+ insert_left(dq, &left, &right, val);
+ break;
+ case 2:
+ printf("Enter value: ");
+ scanf("%d", &val);
+ insert_right(dq, &left, &right, val);
+ break;
+ case 3:
+ retrieve_left(dq, &left, &right);
+ break;
+ case 4:
+ retrieve_right(dq, &left, &right);
+ break;
+ case 5:
+ display(dq, left, right);
+ break;
+ case 6:
+ exit(0);
+ default:
+ printf("Invalid choice!\n");
+ }
+ }
+ return 0;
+}
+
+void insert_left(int *dq, int *left, int *right, int val)
+{
+ // Check if full
+ if ((*left == 0 && *right == MAX - 1) || (*left == *right + 1))
+ {
+ printf("Overflow! Dequeue is full.\n");
+ return;
+ }
+
+ if (*left == -1) // Initially empty
+ {
+ *left = 0;
+ *right = 0;
+ }
+ else if (*left == 0) // Wrap around
+ *left = MAX - 1;
+ else
+ (*left)--;
+
+ dq[*left] = val;
+ printf("Inserted %d at Left.\n", val);
+}
+
+void insert_right(int *dq, int *left, int *right, int val)
+{
+ if ((*left == 0 && *right == MAX - 1) || (*left == *right + 1))
+ {
+ printf("Overflow! Dequeue is full.\n");
+ return;
+ }
+
+ if (*left == -1) // Initially empty
+ {
+ *left = 0;
+ *right = 0;
+ }
+ else if (*right == MAX - 1) // Wrap around
+ *right = 0;
+ else
+ (*right)++;
+
+ dq[*right] = val;
+ printf("Inserted %d at Right.\n", val);
+}
+
+void retrieve_left(int *dq, int *left, int *right)
+{
+ if (*left == -1)
+ {
+ printf("Underflow! Dequeue is empty.\n");
+ return;
+ }
+
+ printf("Retrieved from Left: %d\n", dq[*left]);
+
+ if (*left == *right) // Only one element was present
+ {
+ *left = -1;
+ *right = -1;
+ }
+ else if (*left == MAX - 1)
+ *left = 0;
+ else
+ (*left)++;
+}
+
+void retrieve_right(int *dq, int *left, int *right)
+{
+ if (*left == -1)
+ {
+ printf("Underflow! Dequeue is empty.\n");
+ return;
+ }
+
+ printf("Retrieved from Right: %d\n", dq[*right]);
+
+ if (*left == *right) // Only one element was present
+ {
+ *left = -1;
+ *right = -1;
+ }
+ else if (*right == 0)
+ *right = MAX - 1;
+ else
+ (*right)--;
+}
+
+void display(int *dq, int left, int right)
+{
+ int i;
+ if (left == -1)
+ {
+ printf("Dequeue is Empty\n");
+ return;
+ }
+
+ printf("Elements: ");
+ i = left;
+ while (1)
+ {
+ printf("%d ", dq[i]);
+ if (i == right)
+ break;
+ if (i == MAX - 1)
+ i = 0;
+ else
+ i++;
+ }
+ printf("\n");
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc065.c b/Semester_1/letusc/luc065.c
@@ -0,0 +1,59 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to find if a square matrix is symmetric.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat[10][10], n, i, j;
+ int is_symmetric = 1;
+
+ printf("Enter the size of the square matrix (max 10): ");
+ scanf("%d", &n);
+
+ printf("Enter elements of the %dx%d matrix:\n", n, n);
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ scanf("%d", &mat[i][j]);
+ }
+ }
+
+ // Check for symmetry: mat[i][j] must equal mat[j][i]
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ if (mat[i][j] != mat[j][i])
+ {
+ is_symmetric = 0;
+ break;
+ }
+ }
+ if (is_symmetric == 0)
+ break;
+ }
+
+ if (is_symmetric)
+ printf("\nThe matrix is Symmetric.\n");
+ else
+ printf("\nThe matrix is NOT Symmetric.\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc066.c b/Semester_1/letusc/luc066.c
@@ -0,0 +1,59 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to add two 6 x 6 matrices.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat1[6][6], mat2[6][6], sum[6][6];
+ int i, j;
+
+ // Initializing matrices with some values automatically
+ // to avoid asking user to enter 72 numbers.
+ printf("Initializing two 6x6 matrices with sample data...\n");
+
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ mat1[i][j] = i + j; // Example data
+ mat2[i][j] = i * j; // Example data
+ }
+ }
+
+ // Adding matrices
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ sum[i][j] = mat1[i][j] + mat2[i][j];
+ }
+ }
+
+ printf("\nSum of the two 6x6 matrices:\n");
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ printf("%4d ", sum[i][j]);
+ }
+ printf("\n");
+ }
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc067.c b/Semester_1/letusc/luc067.c
@@ -0,0 +1,64 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to multiply any two 3 x 3 matrices.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(g) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat1[3][3], mat2[3][3], res[3][3];
+ int i, j, k;
+
+ printf("Enter elements of first 3x3 matrix:\n");
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ scanf("%d", &mat1[i][j]);
+
+ printf("Enter elements of second 3x3 matrix:\n");
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ scanf("%d", &mat2[i][j]);
+
+ // Initialize result matrix to 0
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ res[i][j] = 0;
+
+ // Multiplication Logic
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ res[i][j] += mat1[i][k] * mat2[k][j];
+ }
+ }
+ }
+
+ printf("\nResult of Multiplication:\n");
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ printf("%4d ", res[i][j]);
+ }
+ printf("\n");
+ }
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc068.c b/Semester_1/letusc/luc068.c
@@ -0,0 +1,78 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Given an array p[5], write a function to shift it circularly left by two positions. Call this function for a 4 x 5 matrix and get its rows left shifted.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(h) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void shift_left_two(int *p, int n);
+void print_row(int *p, int n);
+
+int main()
+{
+ int mat[4][5] = {
+ {15, 30, 28, 19, 61},
+ {1, 2, 3, 4, 5},
+ {10, 20, 30, 40, 50},
+ {5, 4, 3, 2, 1}
+ };
+ int i;
+
+ printf("Original Matrix:\n");
+ for (i = 0; i < 4; i++)
+ print_row(mat[i], 5);
+
+ // Apply shift to each row
+ for (i = 0; i < 4; i++)
+ {
+ shift_left_two(mat[i], 5);
+ }
+
+ printf("\nMatrix after shifting each row left by 2:\n");
+ for (i = 0; i < 4; i++)
+ print_row(mat[i], 5);
+
+ return 0;
+}
+
+void shift_left_two(int *p, int n)
+{
+ if (n < 2) return; // Cannot shift if less than 2 elements
+
+ int temp1 = p[0];
+ int temp2 = p[1];
+ int i;
+
+ // Shift elements left by 2
+ for (i = 0; i < n - 2; i++)
+ {
+ p[i] = p[i + 2];
+ }
+
+ // Place the first two elements at the end
+ p[n - 2] = temp1;
+ p[n - 1] = temp2;
+}
+
+void print_row(int *p, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ printf("%d ", p[i]);
+ }
+ printf("\n");
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc069.c b/Semester_1/letusc/luc069.c
@@ -0,0 +1,37 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If the string "Alice in wonder land" is fed to the following scanf() statement, what will be the contents of arrays str1, str2, str3 and str4?
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char str1[20], str2[20], str3[20], str4[20];
+
+ printf("Enter the string 'Alice in wonder land': ");
+ /* scanf stops reading at the first whitespace character for %s */
+ scanf("%s%s%s%s", str1, str2, str3, str4);
+
+ printf("\nContents of arrays:\n");
+ printf("str1: %s\n", str1);
+ printf("str2: %s\n", str2);
+ printf("str3: %s\n", str3);
+ printf("str4: %s\n", str4);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc070.c b/Semester_1/letusc/luc070.c
@@ -0,0 +1,60 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives a 10-digit ISBN number, computes the checksum (d1 + 2d2 + 3d3 + ... + 10d10), and reports whether the ISBN number is correct (sum divisible by 11).
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char isbn[15];
+ int i, sum = 0, digit;
+
+ printf("Enter 10-digit ISBN number: ");
+ scanf("%s", isbn);
+
+ /* The formula given is: d1 + 2d2 + 3d3 + ... + 10d10
+ where di is the ith digit from the RIGHT.
+
+ If input is "007462542X" (Length 10):
+ isbn[0] is d10 (Weight 10)
+ isbn[1] is d9 (Weight 9)
+ ...
+ isbn[9] is d1 (Weight 1)
+ */
+
+ for (i = 0; i < 10; i++)
+ {
+ // Handle 'X' which represents 10 in ISBN
+ if (isbn[i] == 'X' || isbn[i] == 'x')
+ digit = 10;
+ else
+ digit = isbn[i] - '0';
+
+ // Weight is (10 - i)
+ sum += digit * (10 - i);
+ }
+
+ printf("Calculated Checksum: %d\n", sum);
+
+ if (sum % 11 == 0)
+ printf("The ISBN number is Correct.\n");
+ else
+ printf("The ISBN number is Incorrect.\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc071.c b/Semester_1/letusc/luc071.c
@@ -0,0 +1,64 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives a 16-digit Credit Card number and checks whether it is valid using the Luhn algorithm variant described.
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char card[20];
+ int i, digit, sum = 0;
+
+ printf("Enter 16-digit Credit Card number: ");
+ scanf("%s", card);
+
+ /* Rule:
+ 1. Start with rightmost-1 digit (index 14) and multiply every other digit by 2.
+ (These are indices 0, 2, 4, ..., 14)
+ 2. Subtract 9 if result >= 10.
+ 3. Add these results.
+ 4. Add remaining digits (indices 1, 3, ..., 15).
+ 5. If total sum is divisible by 10, it is valid.
+ */
+
+ for (i = 0; i < 16; i++)
+ {
+ digit = card[i] - '0';
+
+ if (i % 2 == 0) // Indices 0, 2, 4... (Every other starting from left, which hits rightmost-1)
+ {
+ digit = digit * 2;
+ if (digit >= 10)
+ {
+ digit = digit - 9;
+ }
+ }
+
+ // Add to total sum (both modified and unmodified digits)
+ sum += digit;
+ }
+
+ printf("Total Sum: %d\n", sum);
+
+ if (sum % 10 == 0)
+ printf("The Credit Card number is Valid.\n");
+ else
+ printf("The Credit Card number is Invalid.\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc072.c b/Semester_1/letusc/luc072.c
@@ -0,0 +1,67 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* How many bytes in memory would be occupied by the following array of pointers to strings? How many bytes would be required to store the same strings in a two-dimensional character array?
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ /* Question Analysis:
+ char *mess[] = {"Hammer and tongs", "Tooth and nail", "Spit and polish", "You and C"};
+
+ 1. Array of Pointers (*mess[]):
+ - It stores 4 pointers.
+ - Size of a pointer is typically 4 bytes (32-bit) or 8 bytes (64-bit).
+ - Total = 4 * sizeof(char*)
+ - Plus the strings themselves are stored elsewhere in memory.
+
+ 2. Two-Dimensional Array (mess[][]):
+ - Must accommodate the longest string ("Hammer and tongs" = 16 chars + null = 17).
+ - Width would be 17 (or more).
+ - Size = 4 rows * 17 cols * 1 byte.
+ */
+
+ char *mess_ptr[] = {
+ "Hammer and tongs",
+ "Tooth and nail",
+ "Spit and polish",
+ "You and C"
+ };
+
+ // Longest string length + 1 for null terminator
+ // "Hammer and tongs" is 16 chars long.
+ char mess_2d[4][17] = {
+ "Hammer and tongs",
+ "Tooth and nail",
+ "Spit and polish",
+ "You and C"
+ };
+
+ printf("--- Memory Occupation Analysis ---\n\n");
+
+ printf("1. Array of Pointers (char *mess[]):\n");
+ printf(" Size of array object itself (4 pointers): %zu bytes\n", sizeof(mess_ptr));
+ printf(" (Note: The string literals are stored in read-only memory separately)\n\n");
+
+ printf("2. Two-Dimensional Array (char mess[4][17]):\n");
+ printf(" Size of 2D array: %zu bytes\n", sizeof(mess_2d));
+ printf(" (Calculation: 4 rows * 17 columns * 1 byte)\n");
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc073.c b/Semester_1/letusc/luc073.c
@@ -0,0 +1,50 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to delete all vowels from a sentence. Assume that the sentence is not more than 80 characters long.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char str[81], res[81];
+ int i, j = 0;
+
+ printf("Enter a sentence (max 80 chars): ");
+ gets(str); // Note: gets is deprecated, but used here for simplicity as per classic C texts
+
+ for (i = 0; str[i] != '\0'; i++)
+ {
+ char ch = tolower(str[i]);
+ if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
+ {
+ // Skip vowel
+ continue;
+ }
+ else
+ {
+ res[j] = str[i];
+ j++;
+ }
+ }
+ res[j] = '\0';
+
+ printf("Sentence without vowels: %s\n", res);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc074.c b/Semester_1/letusc/luc074.c
@@ -0,0 +1,61 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that will read a line and delete from it all occurrences of the word 'the'.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char str[100], res[100];
+ int i = 0, j = 0;
+
+ printf("Enter a line of text: ");
+ gets(str);
+
+ while (str[i] != '\0')
+ {
+ /* Check if the current segment matches "the" */
+ /* To be a word 'the', it should effectively be surrounded by non-alphabets or start/end of string.
+ For simplicity in this context, we check if str[i..] starts with "the" */
+
+ if ((str[i] == 't' || str[i] == 'T') &&
+ (str[i+1] == 'h' || str[i+1] == 'H') &&
+ (str[i+2] == 'e' || str[i+2] == 'E') &&
+ (str[i+3] == ' ' || str[i+3] == '\0'))
+ {
+ // Found "the" followed by space or null. Skip "the".
+ i += 3;
+
+ // If it was followed by a space, we might want to skip the space too
+ // to avoid double spaces, but the problem says delete 'the'.
+ // Let's just skip the word.
+ }
+ else
+ {
+ res[j] = str[i];
+ j++;
+ i++;
+ }
+ }
+ res[j] = '\0';
+
+ printf("Text after removing 'the': %s\n", res);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc075.c b/Semester_1/letusc/luc075.c
@@ -0,0 +1,78 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that stores a set of names of individuals and abbreviates the first and middle name to their first letter.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(d) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char names[5][50];
+ char abbr[50];
+ int i, j, k, len, space_count;
+
+ printf("Enter 5 full names (First Middle Last):\n");
+ for (i = 0; i < 5; i++)
+ {
+ printf("Name %d: ", i + 1);
+ gets(names[i]);
+ }
+
+ printf("\nAbbreviated Names:\n");
+ for (i = 0; i < 5; i++)
+ {
+ len = strlen(names[i]);
+ space_count = 0;
+ k = 0;
+
+ // Add first initial
+ abbr[k++] = names[i][0];
+ abbr[k++] = '.';
+ abbr[k++] = ' ';
+
+ // Find spaces to get subsequent parts
+ for (j = 0; j < len; j++)
+ {
+ if (names[i][j] == ' ')
+ {
+ space_count++;
+ if (space_count == 1) // Found start of Middle name
+ {
+ abbr[k++] = names[i][j+1];
+ abbr[k++] = '.';
+ abbr[k++] = ' ';
+ }
+ else if (space_count == 2) // Found start of Last name
+ {
+ // Copy the rest of the last name
+ int m = j + 1;
+ while (names[i][m] != '\0')
+ {
+ abbr[k++] = names[i][m++];
+ }
+ // Stop searching
+ break;
+ }
+ }
+ }
+ abbr[k] = '\0';
+ printf("%s\n", abbr);
+ }
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc076.c b/Semester_1/letusc/luc076.c
@@ -0,0 +1,50 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to count the number of occurrences of any two vowels in succession in a line of text.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int is_vowel(char c)
+{
+ c = tolower(c);
+ return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
+}
+
+int main()
+{
+ char str[100];
+ int i, count = 0;
+
+ printf("Enter a line of text: ");
+ gets(str);
+
+ printf("Occurrences found:\n");
+ for (i = 0; str[i] != '\0'; i++)
+ {
+ if (is_vowel(str[i]) && is_vowel(str[i+1]))
+ {
+ printf("'%c%c' ", str[i], str[i+1]);
+ count++;
+ }
+ }
+
+ printf("\n\nTotal number of successive vowels: %d\n", count);
+
+ return 0;
+}+
\ No newline at end of file
diff --git a/Semester_1/letusc/luc077.c b/Semester_1/letusc/luc077.c
@@ -0,0 +1,76 @@
+/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives an integer (less than or equal to nine digits in length) and prints out the number in words.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+void convert(long, char *);
+
+char *one[] = {
+ "", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ",
+ "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ",
+ "Seventeen ", "Eighteen ", "Nineteen "
+};
+
+char *ten[] = {
+ "", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
+};
+
+int main()
+{
+ long num;
+
+ printf("Enter a number (max 9 digits): ");
+ scanf("%ld", &num);
+
+ if (num <= 0)
+ {
+ printf("Zero\n");
+ }
+ else
+ {
+ printf("In words: ");
+ // Indian System: Crore, Lakh, Thousand, Hundred
+ convert((num / 10000000), "Crore ");
+ convert(((num / 100000) % 100), "Lakh ");
+ convert(((num / 1000) % 100), "Thousand ");
+ convert(((num / 100) % 10), "Hundred ");
+ convert((num % 100), "");
+ printf("\n");
+ }
+
+ return 0;
+}
+
+void convert(long n, char *suffix)
+{
+ if (n > 19)
+ {
+ printf("%s%s", ten[n / 10], one[n % 10]);
+ }
+ else
+ {
+ printf("%s", one[n]);
+ }
+
+ if (n > 0)
+ {
+ printf("%s", suffix);
+ }
+}+
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
@@ -6111,6 +6111,29 @@ if __name__ == "__main__":
<div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5">
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-interest-h', 'interest.h', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/interest.h')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">interest.h</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/interest.h" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-interest-h" style="display:none;">/*
+ * Author : Amit Dutta
+ * File : interest.h
+ */
+
+#define SIMPLE_INTEREST(p, r, t) ((p * r * t) / 100.0)
+#define AMOUNT(p, si) (p + si)
+</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
<div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc001-c', 'luc001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc001.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
@@ -9159,6 +9182,2137 @@ Test Point (101.1, 201.2) is inside ABC.
</div>
<div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc049-c', 'luc049.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc049.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc049.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc049.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc049-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* A positive integer is entered through the keyboard, write a function to find the binary equivalent of this number:
+(1) Without using recursion
+(2) Using recursion
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(a) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int binary_non_rec(int);
+void binary_rec(int);
+
+int main()
+{
+ int num, bin;
+
+ printf("Enter a positive integer: ");
+ scanf("%d", &num);
+
+ bin = binary_non_rec(num);
+ printf("Binary (Non-Recursive): %d\n", bin);
+
+ printf("Binary (Recursive): ");
+ binary_rec(num);
+ printf("\n");
+
+ return 0;
+}
+
+int binary_non_rec(int n)
+{
+ int rem, i = 1, bin = 0;
+ while (n != 0)
+ {
+ rem = n % 2;
+ n = n / 2;
+ bin = bin + rem * i;
+ i = i * 10;
+ }
+ return bin;
+}
+
+void binary_rec(int n)
+{
+ if (n > 1)
+ binary_rec(n / 2);
+
+ printf("%d", n % 2);
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc050-c', 'luc050.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc050.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc050.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc050.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc050-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a recursive function to obtain the sum of first 25 natural numbers.
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(b) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int get_sum(int);
+
+int main()
+{
+ int n = 25, sum;
+
+ sum = get_sum(n);
+ printf("Sum of first %d natural numbers is: %d\n", n, sum);
+
+ return 0;
+}
+
+int get_sum(int n)
+{
+ if (n == 0)
+ return 0;
+ else
+ return n + get_sum(n - 1);
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc051-c', 'luc051.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc051.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc051.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc051.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc051-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Tower of Hanoi: Write a program to print out the sequence in which 4 disks should be moved from peg A to peg C using peg B.
+*/
+/* Let Us C, Chap- 10 (Recursive), Qn No.: B(c) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void hanoi(int, char, char, char);
+
+int main()
+{
+ int n = 4;
+
+ printf("Sequence of moves for %d disks:\n\n", n);
+ hanoi(n, 'A', 'B', 'C');
+
+ return 0;
+}
+
+void hanoi(int n, char from_rod, char aux_rod, char to_rod)
+{
+ if (n == 1)
+ {
+ printf("Move disk 1 from rod %c to rod %c\n", from_rod, to_rod);
+ return;
+ }
+ hanoi(n - 1, from_rod, to_rod, aux_rod);
+ printf("Move disk %d from rod %c to rod %c\n", n, from_rod, to_rod);
+ hanoi(n - 1, aux_rod, from_rod, to_rod);
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc052-c', 'luc052.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc052.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc052.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc052.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc052-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If a macro is not getting expanded as per your expectation, how will you find out how is it being expanded by the preprocessor?
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(a) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ printf("To see how macros are expanded, use the compiler flag '-E'.\n");
+ printf("Command: gcc -E filename.c\n");
+ printf("This outputs the file after preprocessing stage.\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc053-c', 'luc053.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc053.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc053.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc053.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc053-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write macro definitions for: Mean, Absolute value, Uppercase to Lowercase, Biggest of three.
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(b) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define MEAN(x, y) ((x + y) / 2.0)
+#define ABS(x) ((x) < 0 ? -(x) : (x))
+#define TO_LOWER(x) ((x) >= 'A' && (x) <= 'Z' ? (x) + 32 : (x))
+#define MAX(x, y, z) ((x) > (y) ? ((x) > (z) ? (x) : (z)) : ((y) > (z) ? (y) : (z)))
+
+int main()
+{
+ int a, b, c, num;
+ char ch;
+
+ printf("Enter two numbers for Mean: ");
+ scanf("%d %d", &a, &b);
+ printf("Mean: %.2f\n\n", MEAN(a, b));
+
+ printf("Enter a number for Absolute value: ");
+ scanf("%d", &num);
+ printf("Absolute: %d\n\n", ABS(num));
+
+ printf("Enter an uppercase character: ");
+ scanf(" %c", &ch);
+ printf("Lowercase: %c\n\n", TO_LOWER(ch));
+
+ printf("Enter three numbers: ");
+ scanf("%d %d %d", &a, &b, &c);
+ printf("Biggest: %d\n", MAX(a, b, c));
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc054-c', 'luc054.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc054.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc054.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc054.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc054-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Use 'interest.h' macros to calculate Simple Interest and Amount.
+*/
+/* Let Us C, Chap- 12 (The C Preprocessor), Qn No.: C(c) */
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#include "interest.h"
+
+int main()
+{
+ float p, r, t, si, amt;
+
+ printf("Enter Principal, Rate and Time: ");
+ scanf("%f %f %f", &p, &r, &t);
+
+ si = SIMPLE_INTEREST(p, r, t);
+ amt = AMOUNT(p, si);
+
+ printf("Simple Interest: %.2f\n", si);
+ printf("Total Amount: %.2f\n", amt);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc055-c', 'luc055.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc055.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc055.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc055.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc055-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how many are negative, how many are even and how many odd.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[25], i;
+ int pos = 0, neg = 0, even = 0, odd = 0;
+
+ printf("Enter 25 integers:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+
+ if (arr[i] > 0)
+ pos++;
+ else if (arr[i] < 0)
+ neg++;
+
+ if (arr[i] % 2 == 0)
+ even++;
+ else
+ odd++;
+ }
+
+ printf("\nResults:\n");
+ printf("Positive: %d\n", pos);
+ printf("Negative: %d\n", neg);
+ printf("Even: %d\n", even);
+ printf("Odd: %d\n", odd);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc056-c', 'luc056.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc056.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc056.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc056.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc056-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If an array arr contains n elements, then write a program to check if arr[0] = arr[n-1], arr[1] = arr[n-2] and so on.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[100], n, i, symmetric = 1;
+
+ printf("Enter number of elements (n): ");
+ scanf("%d", &n);
+
+ printf("Enter %d elements: ", n);
+ for (i = 0; i < n; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ // Check symmetry
+ for (i = 0; i < n / 2; i++)
+ {
+ if (arr[i] != arr[n - 1 - i])
+ {
+ symmetric = 0;
+ break;
+ }
+ }
+
+ if (symmetric)
+ printf("\nThe array is symmetric (Palindrome).\n");
+ else
+ printf("\nThe array is NOT symmetric.\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc057-c', 'luc057.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc057.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc057.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc057.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc057-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program using pointers to find the smallest number in an array of 25 integers.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int arr[25], i, min;
+ int *ptr;
+
+ printf("Enter 25 integers:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ ptr = arr; // Point to start of array
+ min = *ptr; // Initialize min with first element
+
+ for (i = 1; i < 25; i++)
+ {
+ ptr++; // Move pointer to next element
+ if (*ptr < min)
+ {
+ min = *ptr;
+ }
+ }
+
+ printf("\nSmallest number is: %d\n", min);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc058-c', 'luc058.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc058.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc058.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc058.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc058-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Implement the Insertion Sort algorithm shown in Figure 13.3 on a set of 25 numbers.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(d) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void insertion_sort(int *, int);
+
+int main()
+{
+ int arr[25], i;
+
+ printf("Enter 25 integers for Insertion Sort:\n");
+ for (i = 0; i < 25; i++)
+ {
+ scanf("%d", &arr[i]);
+ }
+
+ insertion_sort(arr, 25);
+
+ printf("\nSorted Array:\n");
+ for (i = 0; i < 25; i++)
+ {
+ printf("%d ", arr[i]);
+ }
+ printf("\n");
+
+ return 0;
+}
+
+void insertion_sort(int *arr, int n)
+{
+ int i, j, key;
+ for (i = 1; i < n; i++)
+ {
+ key = arr[i];
+ j = i - 1;
+
+ /* Move elements of arr[0..i-1], that are greater than key,
+ to one position ahead of their current position */
+ while (j >= 0 && arr[j] > key)
+ {
+ arr[j + 1] = arr[j];
+ j = j - 1;
+ }
+ arr[j + 1] = key;
+ }
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc059-c', 'luc059.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc059.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc059.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc059.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc059-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program which initializes an integer array of 10 elements in main(), passes it to modify(), multiplies each element by 3, and prints the new array in main().
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+void modify(int *, int);
+
+int main()
+{
+ int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ int i;
+
+ printf("Original Array:\n");
+ for (i = 0; i < 10; i++)
+ printf("%d ", arr[i]);
+
+ modify(arr, 10);
+
+ printf("\n\nModified Array (x3):\n");
+ for (i = 0; i < 10; i++)
+ printf("%d ", arr[i]);
+ printf("\n");
+
+ return 0;
+}
+
+void modify(int *a, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[i] = a[i] * 3;
+ }
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc060-c', 'luc060.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc060.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc060.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc060.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc060-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* For the following set of sample data, compute the standard deviation and the mean.\nData: -6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ int data[] = {-6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2};
+ int n = 15, i;
+ double sum = 0.0, mean, std_dev = 0.0;
+
+ // Calculate Mean
+ for (i = 0; i < n; i++)
+ {
+ sum += data[i];
+ }
+ mean = sum / n;
+
+ // Calculate Standard Deviation
+ for (i = 0; i < n; i++)
+ {
+ std_dev += pow(data[i] - mean, 2);
+ }
+ std_dev = sqrt(std_dev / n);
+
+ printf("Count: %d\n", n);
+ printf("Mean: %.2f\n", mean);
+ printf("Standard Deviation: %.2f\n", std_dev);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc061-c', 'luc061.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc061.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc061.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc061.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc061-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* The area of a triangle can be computed by the sine law. Given 6 triangular pieces of land (a, b, angle), find their area and determine which is largest.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(g) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ // Data arrays
+ double a[] = {137.4, 155.2, 149.3, 160.0, 155.6, 149.7};
+ double b[] = {80.9, 92.62, 97.93, 100.25, 68.95, 120.0};
+ double angle[] = {0.78, 0.89, 1.35, 9.00, 1.25, 1.75}; // Assuming radians based on values < 2.0. 9.00 is treated as literal.
+
+ double area, max_area = 0.0;
+ int i, max_index = -1;
+
+ printf("Plot No.\tArea\n");
+ printf("------------------------\n");
+
+ for (i = 0; i < 6; i++)
+ {
+ // Area = 1/2 * a * b * sin(angle)
+ area = 0.5 * a[i] * b[i] * sin(angle[i]);
+
+ printf("%d\t\t%.2f\n", i + 1, area);
+
+ if (area > max_area)
+ {
+ max_area = area;
+ max_index = i + 1;
+ }
+ }
+
+ printf("\nLargest Plot is No. %d with Area: %.2f\n", max_index, max_area);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc062-c', 'luc062.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc062.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc062.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc062.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc062-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* For the following set of n data points (x, y), write a program to compute the correlation coefficient r.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(h) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ double x[] = {34.22, 39.87, 41.85, 43.23, 40.06, 53.29, 53.29, 54.14, 49.12, 40.71, 55.15};
+ double y[] = {102.43, 100.93, 97.43, 97.81, 98.32, 98.32, 100.07, 97.08, 91.59, 94.85, 94.65};
+
+ int n = 11, i;
+ double sum_x = 0, sum_y = 0, sum_xy = 0, sum_x2 = 0, sum_y2 = 0;
+ double numerator, denominator, r;
+
+ for (i = 0; i < n; i++)
+ {
+ sum_x += x[i];
+ sum_y += y[i];
+ sum_xy += x[i] * y[i];
+ sum_x2 += x[i] * x[i];
+ sum_y2 += y[i] * y[i];
+ }
+
+ numerator = (n * sum_xy) - (sum_x * sum_y);
+ denominator = sqrt((n * sum_x2 - sum_x * sum_x) * (n * sum_y2 - sum_y * sum_y));
+
+ if (denominator != 0)
+ r = numerator / denominator;
+ else
+ r = 0; // Avoid division by zero
+
+ printf("Correlation coefficient (r) = %.4f\n", r);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc063-c', 'luc063.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc063.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc063.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc063.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc063-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* The X and Y coordinates of 10 different points are entered through the keyboard. Write a program to find the distance of last point from the first point (sum of distances between consecutive points).
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(i) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ double x[10], y[10];
+ double total_distance = 0.0;
+ int i;
+
+ printf("Enter coordinates (x, y) for 10 points:\n");
+ for (i = 0; i < 10; i++)
+ {
+ printf("Point %d: ", i + 1);
+ scanf("%lf %lf", &x[i], &y[i]);
+ }
+
+ // Sum of distances between consecutive points P(i) and P(i+1)
+ for (i = 0; i < 9; i++)
+ {
+ double dx = x[i+1] - x[i];
+ double dy = y[i+1] - y[i];
+ total_distance += sqrt(dx*dx + dy*dy);
+ }
+
+ printf("\nTotal distance from first to last point: %.2f\n", total_distance);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc064-c', 'luc064.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc064.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc064.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc064.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc064-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Simulate a Dequeue (Double Ended Queue) using an array. Support: retrieve left, retrieve right, insert left, insert right. Use pointers left and right.
+*/
+
+/* Let Us C, Chap- 13 (Arrays), Qn No.: B(j) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define MAX 10
+
+void insert_left(int *, int *, int *, int);
+void insert_right(int *, int *, int *, int);
+void retrieve_left(int *, int *, int *);
+void retrieve_right(int *, int *, int *);
+void display(int *, int, int);
+
+int main()
+{
+ int dq[MAX];
+ int left = -1, right = -1;
+ int choice, val;
+
+ while (1)
+ {
+ printf("\n--- Dequeue Menu ---\n");
+ printf("1. Insert Left\n2. Insert Right\n");
+ printf("3. Retrieve Left\n4. Retrieve Right\n");
+ printf("5. Display\n6. Exit\n");
+ printf("Enter choice: ");
+ scanf("%d", &choice);
+
+ switch (choice)
+ {
+ case 1:
+ printf("Enter value: ");
+ scanf("%d", &val);
+ insert_left(dq, &left, &right, val);
+ break;
+ case 2:
+ printf("Enter value: ");
+ scanf("%d", &val);
+ insert_right(dq, &left, &right, val);
+ break;
+ case 3:
+ retrieve_left(dq, &left, &right);
+ break;
+ case 4:
+ retrieve_right(dq, &left, &right);
+ break;
+ case 5:
+ display(dq, left, right);
+ break;
+ case 6:
+ exit(0);
+ default:
+ printf("Invalid choice!\n");
+ }
+ }
+ return 0;
+}
+
+void insert_left(int *dq, int *left, int *right, int val)
+{
+ // Check if full
+ if ((*left == 0 && *right == MAX - 1) || (*left == *right + 1))
+ {
+ printf("Overflow! Dequeue is full.\n");
+ return;
+ }
+
+ if (*left == -1) // Initially empty
+ {
+ *left = 0;
+ *right = 0;
+ }
+ else if (*left == 0) // Wrap around
+ *left = MAX - 1;
+ else
+ (*left)--;
+
+ dq[*left] = val;
+ printf("Inserted %d at Left.\n", val);
+}
+
+void insert_right(int *dq, int *left, int *right, int val)
+{
+ if ((*left == 0 && *right == MAX - 1) || (*left == *right + 1))
+ {
+ printf("Overflow! Dequeue is full.\n");
+ return;
+ }
+
+ if (*left == -1) // Initially empty
+ {
+ *left = 0;
+ *right = 0;
+ }
+ else if (*right == MAX - 1) // Wrap around
+ *right = 0;
+ else
+ (*right)++;
+
+ dq[*right] = val;
+ printf("Inserted %d at Right.\n", val);
+}
+
+void retrieve_left(int *dq, int *left, int *right)
+{
+ if (*left == -1)
+ {
+ printf("Underflow! Dequeue is empty.\n");
+ return;
+ }
+
+ printf("Retrieved from Left: %d\n", dq[*left]);
+
+ if (*left == *right) // Only one element was present
+ {
+ *left = -1;
+ *right = -1;
+ }
+ else if (*left == MAX - 1)
+ *left = 0;
+ else
+ (*left)++;
+}
+
+void retrieve_right(int *dq, int *left, int *right)
+{
+ if (*left == -1)
+ {
+ printf("Underflow! Dequeue is empty.\n");
+ return;
+ }
+
+ printf("Retrieved from Right: %d\n", dq[*right]);
+
+ if (*left == *right) // Only one element was present
+ {
+ *left = -1;
+ *right = -1;
+ }
+ else if (*right == 0)
+ *right = MAX - 1;
+ else
+ (*right)--;
+}
+
+void display(int *dq, int left, int right)
+{
+ int i;
+ if (left == -1)
+ {
+ printf("Dequeue is Empty\n");
+ return;
+ }
+
+ printf("Elements: ");
+ i = left;
+ while (1)
+ {
+ printf("%d ", dq[i]);
+ if (i == right)
+ break;
+ if (i == MAX - 1)
+ i = 0;
+ else
+ i++;
+ }
+ 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('code-Semester_1-letusc-luc065-c', 'luc065.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc065.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc065.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc065.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc065-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to find if a square matrix is symmetric.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat[10][10], n, i, j;
+ int is_symmetric = 1;
+
+ printf("Enter the size of the square matrix (max 10): ");
+ scanf("%d", &n);
+
+ printf("Enter elements of the %dx%d matrix:\n", n, n);
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ scanf("%d", &mat[i][j]);
+ }
+ }
+
+ // Check for symmetry: mat[i][j] must equal mat[j][i]
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ if (mat[i][j] != mat[j][i])
+ {
+ is_symmetric = 0;
+ break;
+ }
+ }
+ if (is_symmetric == 0)
+ break;
+ }
+
+ if (is_symmetric)
+ printf("\nThe matrix is Symmetric.\n");
+ else
+ printf("\nThe matrix is NOT Symmetric.\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc066-c', 'luc066.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc066.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc066.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc066.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc066-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to add two 6 x 6 matrices.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat1[6][6], mat2[6][6], sum[6][6];
+ int i, j;
+
+ // Initializing matrices with some values automatically
+ // to avoid asking user to enter 72 numbers.
+ printf("Initializing two 6x6 matrices with sample data...\n");
+
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ mat1[i][j] = i + j; // Example data
+ mat2[i][j] = i * j; // Example data
+ }
+ }
+
+ // Adding matrices
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ sum[i][j] = mat1[i][j] + mat2[i][j];
+ }
+ }
+
+ printf("\nSum of the two 6x6 matrices:\n");
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ printf("%4d ", sum[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('code-Semester_1-letusc-luc067-c', 'luc067.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc067.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc067.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc067.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc067-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to multiply any two 3 x 3 matrices.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(g) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int mat1[3][3], mat2[3][3], res[3][3];
+ int i, j, k;
+
+ printf("Enter elements of first 3x3 matrix:\n");
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ scanf("%d", &mat1[i][j]);
+
+ printf("Enter elements of second 3x3 matrix:\n");
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ scanf("%d", &mat2[i][j]);
+
+ // Initialize result matrix to 0
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ res[i][j] = 0;
+
+ // Multiplication Logic
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ res[i][j] += mat1[i][k] * mat2[k][j];
+ }
+ }
+ }
+
+ printf("\nResult of Multiplication:\n");
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ printf("%4d ", res[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('code-Semester_1-letusc-luc068-c', 'luc068.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc068.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc068.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc068.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc068-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Given an array p[5], write a function to shift it circularly left by two positions. Call this function for a 4 x 5 matrix and get its rows left shifted.
+*/
+
+/* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(h) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void shift_left_two(int *p, int n);
+void print_row(int *p, int n);
+
+int main()
+{
+ int mat[4][5] = {
+ {15, 30, 28, 19, 61},
+ {1, 2, 3, 4, 5},
+ {10, 20, 30, 40, 50},
+ {5, 4, 3, 2, 1}
+ };
+ int i;
+
+ printf("Original Matrix:\n");
+ for (i = 0; i < 4; i++)
+ print_row(mat[i], 5);
+
+ // Apply shift to each row
+ for (i = 0; i < 4; i++)
+ {
+ shift_left_two(mat[i], 5);
+ }
+
+ printf("\nMatrix after shifting each row left by 2:\n");
+ for (i = 0; i < 4; i++)
+ print_row(mat[i], 5);
+
+ return 0;
+}
+
+void shift_left_two(int *p, int n)
+{
+ if (n < 2) return; // Cannot shift if less than 2 elements
+
+ int temp1 = p[0];
+ int temp2 = p[1];
+ int i;
+
+ // Shift elements left by 2
+ for (i = 0; i < n - 2; i++)
+ {
+ p[i] = p[i + 2];
+ }
+
+ // Place the first two elements at the end
+ p[n - 2] = temp1;
+ p[n - 1] = temp2;
+}
+
+void print_row(int *p, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ printf("%d ", p[i]);
+ }
+ 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('code-Semester_1-letusc-luc069-c', 'luc069.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc069.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc069.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc069.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc069-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* If the string "Alice in wonder land" is fed to the following scanf() statement, what will be the contents of arrays str1, str2, str3 and str4?
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char str1[20], str2[20], str3[20], str4[20];
+
+ printf("Enter the string 'Alice in wonder land': ");
+ /* scanf stops reading at the first whitespace character for %s */
+ scanf("%s%s%s%s", str1, str2, str3, str4);
+
+ printf("\nContents of arrays:\n");
+ printf("str1: %s\n", str1);
+ printf("str2: %s\n", str2);
+ printf("str3: %s\n", str3);
+ printf("str4: %s\n", str4);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc070-c', 'luc070.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc070.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc070.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc070.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc070-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives a 10-digit ISBN number, computes the checksum (d1 + 2d2 + 3d3 + ... + 10d10), and reports whether the ISBN number is correct (sum divisible by 11).
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char isbn[15];
+ int i, sum = 0, digit;
+
+ printf("Enter 10-digit ISBN number: ");
+ scanf("%s", isbn);
+
+ /* The formula given is: d1 + 2d2 + 3d3 + ... + 10d10
+ where di is the ith digit from the RIGHT.
+
+ If input is "007462542X" (Length 10):
+ isbn[0] is d10 (Weight 10)
+ isbn[1] is d9 (Weight 9)
+ ...
+ isbn[9] is d1 (Weight 1)
+ */
+
+ for (i = 0; i < 10; i++)
+ {
+ // Handle 'X' which represents 10 in ISBN
+ if (isbn[i] == 'X' || isbn[i] == 'x')
+ digit = 10;
+ else
+ digit = isbn[i] - '0';
+
+ // Weight is (10 - i)
+ sum += digit * (10 - i);
+ }
+
+ printf("Calculated Checksum: %d\n", sum);
+
+ if (sum % 11 == 0)
+ printf("The ISBN number is Correct.\n");
+ else
+ printf("The ISBN number is Incorrect.\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc071-c', 'luc071.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc071.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc071.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc071.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc071-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives a 16-digit Credit Card number and checks whether it is valid using the Luhn algorithm variant described.
+*/
+
+/* Let Us C, Chap- 15 (Strings), Qn No.: C(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main()
+{
+ char card[20];
+ int i, digit, sum = 0;
+
+ printf("Enter 16-digit Credit Card number: ");
+ scanf("%s", card);
+
+ /* Rule:
+ 1. Start with rightmost-1 digit (index 14) and multiply every other digit by 2.
+ (These are indices 0, 2, 4, ..., 14)
+ 2. Subtract 9 if result >= 10.
+ 3. Add these results.
+ 4. Add remaining digits (indices 1, 3, ..., 15).
+ 5. If total sum is divisible by 10, it is valid.
+ */
+
+ for (i = 0; i < 16; i++)
+ {
+ digit = card[i] - '0';
+
+ if (i % 2 == 0) // Indices 0, 2, 4... (Every other starting from left, which hits rightmost-1)
+ {
+ digit = digit * 2;
+ if (digit >= 10)
+ {
+ digit = digit - 9;
+ }
+ }
+
+ // Add to total sum (both modified and unmodified digits)
+ sum += digit;
+ }
+
+ printf("Total Sum: %d\n", sum);
+
+ if (sum % 10 == 0)
+ printf("The Credit Card number is Valid.\n");
+ else
+ printf("The Credit Card number is Invalid.\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc072-c', 'luc072.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc072.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc072.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc072.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc072-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* How many bytes in memory would be occupied by the following array of pointers to strings? How many bytes would be required to store the same strings in a two-dimensional character array?
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(a) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ /* Question Analysis:
+ char *mess[] = {"Hammer and tongs", "Tooth and nail", "Spit and polish", "You and C"};
+
+ 1. Array of Pointers (*mess[]):
+ - It stores 4 pointers.
+ - Size of a pointer is typically 4 bytes (32-bit) or 8 bytes (64-bit).
+ - Total = 4 * sizeof(char*)
+ - Plus the strings themselves are stored elsewhere in memory.
+
+ 2. Two-Dimensional Array (mess[][]):
+ - Must accommodate the longest string ("Hammer and tongs" = 16 chars + null = 17).
+ - Width would be 17 (or more).
+ - Size = 4 rows * 17 cols * 1 byte.
+ */
+
+ char *mess_ptr[] = {
+ "Hammer and tongs",
+ "Tooth and nail",
+ "Spit and polish",
+ "You and C"
+ };
+
+ // Longest string length + 1 for null terminator
+ // "Hammer and tongs" is 16 chars long.
+ char mess_2d[4][17] = {
+ "Hammer and tongs",
+ "Tooth and nail",
+ "Spit and polish",
+ "You and C"
+ };
+
+ printf("--- Memory Occupation Analysis ---\n\n");
+
+ printf("1. Array of Pointers (char *mess[]):\n");
+ printf(" Size of array object itself (4 pointers): %zu bytes\n", sizeof(mess_ptr));
+ printf(" (Note: The string literals are stored in read-only memory separately)\n\n");
+
+ printf("2. Two-Dimensional Array (char mess[4][17]):\n");
+ printf(" Size of 2D array: %zu bytes\n", sizeof(mess_2d));
+ printf(" (Calculation: 4 rows * 17 columns * 1 byte)\n");
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc073-c', 'luc073.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc073.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc073.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc073.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc073-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to delete all vowels from a sentence. Assume that the sentence is not more than 80 characters long.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(b) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char str[81], res[81];
+ int i, j = 0;
+
+ printf("Enter a sentence (max 80 chars): ");
+ gets(str); // Note: gets is deprecated, but used here for simplicity as per classic C texts
+
+ for (i = 0; str[i] != '\0'; i++)
+ {
+ char ch = tolower(str[i]);
+ if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
+ {
+ // Skip vowel
+ continue;
+ }
+ else
+ {
+ res[j] = str[i];
+ j++;
+ }
+ }
+ res[j] = '\0';
+
+ printf("Sentence without vowels: %s\n", res);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc074-c', 'luc074.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc074.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc074.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc074.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc074-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that will read a line and delete from it all occurrences of the word 'the'.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(c) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char str[100], res[100];
+ int i = 0, j = 0;
+
+ printf("Enter a line of text: ");
+ gets(str);
+
+ while (str[i] != '\0')
+ {
+ /* Check if the current segment matches "the" */
+ /* To be a word 'the', it should effectively be surrounded by non-alphabets or start/end of string.
+ For simplicity in this context, we check if str[i..] starts with "the" */
+
+ if ((str[i] == 't' || str[i] == 'T') &&
+ (str[i+1] == 'h' || str[i+1] == 'H') &&
+ (str[i+2] == 'e' || str[i+2] == 'E') &&
+ (str[i+3] == ' ' || str[i+3] == '\0'))
+ {
+ // Found "the" followed by space or null. Skip "the".
+ i += 3;
+
+ // If it was followed by a space, we might want to skip the space too
+ // to avoid double spaces, but the problem says delete 'the'.
+ // Let's just skip the word.
+ }
+ else
+ {
+ res[j] = str[i];
+ j++;
+ i++;
+ }
+ }
+ res[j] = '\0';
+
+ printf("Text after removing 'the': %s\n", res);
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc075-c', 'luc075.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc075.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc075.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc075.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc075-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that stores a set of names of individuals and abbreviates the first and middle name to their first letter.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(d) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int main()
+{
+ char names[5][50];
+ char abbr[50];
+ int i, j, k, len, space_count;
+
+ printf("Enter 5 full names (First Middle Last):\n");
+ for (i = 0; i < 5; i++)
+ {
+ printf("Name %d: ", i + 1);
+ gets(names[i]);
+ }
+
+ printf("\nAbbreviated Names:\n");
+ for (i = 0; i < 5; i++)
+ {
+ len = strlen(names[i]);
+ space_count = 0;
+ k = 0;
+
+ // Add first initial
+ abbr[k++] = names[i][0];
+ abbr[k++] = '.';
+ abbr[k++] = ' ';
+
+ // Find spaces to get subsequent parts
+ for (j = 0; j < len; j++)
+ {
+ if (names[i][j] == ' ')
+ {
+ space_count++;
+ if (space_count == 1) // Found start of Middle name
+ {
+ abbr[k++] = names[i][j+1];
+ abbr[k++] = '.';
+ abbr[k++] = ' ';
+ }
+ else if (space_count == 2) // Found start of Last name
+ {
+ // Copy the rest of the last name
+ int m = j + 1;
+ while (names[i][m] != '\0')
+ {
+ abbr[k++] = names[i][m++];
+ }
+ // Stop searching
+ break;
+ }
+ }
+ }
+ abbr[k] = '\0';
+ printf("%s\n", abbr);
+ }
+
+ return 0;
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
+ <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-luc076-c', 'luc076.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc076.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc076.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc076.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc076-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program to count the number of occurrences of any two vowels in succession in a line of text.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(e) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+int is_vowel(char c)
+{
+ c = tolower(c);
+ return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
+}
+
+int main()
+{
+ char str[100];
+ int i, count = 0;
+
+ printf("Enter a line of text: ");
+ gets(str);
+
+ printf("Occurrences found:\n");
+ for (i = 0; str[i] != '\0'; i++)
+ {
+ if (is_vowel(str[i]) && is_vowel(str[i+1]))
+ {
+ printf("'%c%c' ", str[i], str[i+1]);
+ count++;
+ }
+ }
+
+ printf("\n\nTotal number of successive vowels: %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('code-Semester_1-letusc-luc077-c', 'luc077.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc077.c')">
+ <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
+ </svg>
+ <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">luc077.c</span>
+ </div>
+ <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
+ <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/luc077.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg>
+ </a>
+ </div>
+ <!-- Embedded Code Storage -->
+ <div id="code-Semester_1-letusc-luc077-c" style="display:none;">/*
+ * Author : Amit Dutta <amitdutta4255@gmail.com>
+ * Date : 08 Feb 2026
+ * Repo : https://github.com/notamitgamer/bsc
+ * License : MIT License (See the LICENSE file for details)
+ * Copyright (c) 2026 Amit Dutta
+ */
+
+/* Write a program that receives an integer (less than or equal to nine digits in length) and prints out the number in words.
+*/
+
+/* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(f) */
+
+/* This file is auto-generated by a bot. */
+/* This code is not compiled; it is for reference only. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+void convert(long, char *);
+
+char *one[] = {
+ "", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ",
+ "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ",
+ "Seventeen ", "Eighteen ", "Nineteen "
+};
+
+char *ten[] = {
+ "", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
+};
+
+int main()
+{
+ long num;
+
+ printf("Enter a number (max 9 digits): ");
+ scanf("%ld", &num);
+
+ if (num <= 0)
+ {
+ printf("Zero\n");
+ }
+ else
+ {
+ printf("In words: ");
+ // Indian System: Crore, Lakh, Thousand, Hundred
+ convert((num / 10000000), "Crore ");
+ convert(((num / 100000) % 100), "Lakh ");
+ convert(((num / 1000) % 100), "Thousand ");
+ convert(((num / 100) % 10), "Hundred ");
+ convert((num % 100), "");
+ printf("\n");
+ }
+
+ return 0;
+}
+
+void convert(long n, char *suffix)
+{
+ if (n > 19)
+ {
+ printf("%s%s", ten[n / 10], one[n % 10]);
+ }
+ else
+ {
+ printf("%s", one[n]);
+ }
+
+ if (n > 0)
+ {
+ printf("%s", suffix);
+ }
+}</div>
+ </div>
+
+ <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1">
<div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-letusc-lucproblem001-c', 'lucproblem001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/letusc/lucproblem001.c')">
<svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />