commit b502150d9b482b6ddeef10bbadda9545b796b10e parent 8b49b6b15eb958f6b564ffa3c0638bd5ff78b478 Author: Amit Dutta <amitdutta4255@gmail.com> Date: Mon, 5 Jan 2026 15:33:01 +0530 [2026-01-05] : .\{root} : added some personal practice file. Diffstat:
| A | Semester_1/practice-c/pc013.c | | | 57 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc014.c | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc015.c | | | 74 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc016.c | | | 101 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc017.c | | | 85 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc018.c | | | 49 | +++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc019.c | | | 56 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc020.c | | | 46 | ++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Semester_1/practice-c/pc021.c | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | docs/generate_index.py | | | 2 | +- |
| M | docs/index.html | | | 747 | ------------------------------------------------------------------------------- |
11 files changed, 577 insertions(+), 748 deletions(-)
diff --git a/Semester_1/practice-c/pc013.c b/Semester_1/practice-c/pc013.c @@ -0,0 +1,56 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps1 */ + +#include <stdio.h> + +int sum(int); +int product(int); + +int main() +{ + int num; + printf("Enter the number: "); + scanf("%d", &num); + printf("\nSum of digit: %d", sum(num)); + printf("\nProduct of digit: %d", product(num)); + return 0; +} + +int sum(int num) +{ + int result = 0; + while (num > 0) + { + result += num % 10; + num /= 10; + } + return result; +} + +int product(int num) +{ + int result = 1; + if (num == 0) + { + return 0; + } + while (num > 0) + { + result *= num % 10; + num /= 10; + } + return result; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc014.c b/Semester_1/practice-c/pc014.c @@ -0,0 +1,44 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps2 */ + +#include <stdio.h> + +int reverse(int); + +int main() +{ + int num; + printf("Enter the number: "); + scanf("%d", &num); + if (num < 0) + { + printf("\nOnly poitive integers are allowed."); + return 1; + } + printf("\nReverse of input %d is : %d", num, reverse(num)); + return 0; +} + +int reverse(int num) +{ + int result = 0; + while (num > 0) + { + result = (result * 10) + (num % 10); + num /= 10; + } + return result; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc015.c b/Semester_1/practice-c/pc015.c @@ -0,0 +1,74 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps20 */ + +#include<stdio.h> +#include<stdlib.h> + +void inputArray(int [], int); +void reverseArray(int [], int); +void printArray(int [], int); + +int main() { + int n, *arr; + printf("How many element do you want enter: "); + scanf("%d", &n); + arr = (int *)malloc(n * sizeof(int)); + if(arr == NULL) { + printf("\nMemory allocation failed."); + return 1; + } + inputArray(arr, n); + printf("\nBefore Reverse: "); + printArray(arr, n); + reverseArray(arr, n); + printf("\nAfter reverse: "); + printArray(arr, n); + free(arr); + return 0; +} + +void inputArray(int arr[], int n) { + int i; + for(i = 0; i < n; i++) { + printf("Enter element %d: ", i + 1); + scanf("%d", &arr[i]); + } +} + +void printArray(int arr[], int n) { + int i; + printf("["); + for(i = 0; i < n; i++) { + printf("%d", arr[i]); + if(i < n - 1) { + printf(", "); + } + } + printf("]"); +} + +void reverseArray(int arr[], int size) { + int i = 0; + int j = size - 1; + int temp; + while(i < j) { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + i++; + j--; + } +} diff --git a/Semester_1/practice-c/pc016.c b/Semester_1/practice-c/pc016.c @@ -0,0 +1,101 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps19 */ + +#include <stdio.h> +#include <stdlib.h> + +int binarySearch(int[], int, int); +void inputArray(int[], int); +void printArray(int[], int); + +int main() +{ + int n, *arr, target, foundIndex; + printf("Enter the number of element: "); + scanf("%d", &n); + arr = (int *)malloc(n * sizeof(int)); + if (arr == NULL) + { + printf("\nMemory allocation failed."); + return 1; + } + printf("\nPlease enter the sorted array element(s): \n"); + inputArray(arr, n); + printf("\nGiven array: "); + printArray(arr, n); + printf("\nPlease enter the target element: "); + scanf("%d", &target); + foundIndex = binarySearch(arr, n, target); + if (foundIndex != -1) + { + printf("\nTarget '%d' found at Index %d.", target, foundIndex); + } + else + { + printf("\nUnable to find target '%d'.", target); + } + free(arr); + return 0; +} + +void inputArray(int arr[], int n) +{ + int i; + for (i = 0; i < n; i++) + { + printf("Enter element %d: ", i + 1); + scanf("%d", &arr[i]); + } +} + +void printArray(int arr[], int n) +{ + int i; + printf("["); + for (i = 0; i < n; i++) + { + printf("%d", arr[i]); + if (i < n - 1) + { + printf(", "); + } + } + printf("]"); +} + +int binarySearch(int arr[], int size, int target) +{ + int low = 0; + int high = size - 1; + int mid; + while (low <= high) + { + mid = (low + high) / 2; + if (arr[mid] == target) + { + return mid; + } + else if (arr[mid] > target) + { + high = mid - 1; + } + else if (arr[mid] < target) + { + low = mid + 1; + } + } + return -1; +} diff --git a/Semester_1/practice-c/pc017.c b/Semester_1/practice-c/pc017.c @@ -0,0 +1,84 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps18 */ + +#include <stdio.h> +#include <stdlib.h> + +int findLargest(int[], int); +void inputArray(int[], int); +void printArray(int[], int); + +int main() +{ + int n, *arr; + printf("Enter the number of element: "); + scanf("%d", &n); + if (n < 2) + { + printf("\nTo get highest element, there must be atleast 2 element."); + return 1; + } + arr = (int *)malloc(n * sizeof(int)); + if (arr == NULL) + { + printf("\nMemory allocation failed."); + return 1; + } + inputArray(arr, n); + printf("\nGiven Array: "); + printArray(arr, n); + printf("\nLargest element of the array: %d", findLargest(arr, n)); + free(arr); + return 0; +} + +void inputArray(int arr[], int n) +{ + int i; + for (i = 0; i < n; i++) + { + printf("Enter element %d: ", i + 1); + scanf("%d", &arr[i]); + } +} + +void printArray(int arr[], int n) +{ + int i; + printf("["); + for (i = 0; i < n; i++) + { + printf("%d", arr[i]); + if (i < n - 1) + { + printf(", "); + } + } + printf("]"); +} + +int findLargest(int arr[], int size) +{ + int i, largest = arr[0]; + for (i = 1; i < size; i++) + { + if (arr[i] > largest) + { + largest = arr[i]; + } + } + return largest; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc018.c b/Semester_1/practice-c/pc018.c @@ -0,0 +1,48 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps17 */ + +#include <stdio.h> + +int isPerfect(int); + +int main() +{ + int num; + printf("Enter the number : "); + scanf("%d", &num); + if (isPerfect(num)) + { + printf("\nInput '%d' is a perfect number.", num); + } + else + { + printf("\nInput '%d' is not a perfect number.", num); + } + return 0; +} + +int isPerfect(int n) +{ + int i, sum = 0; + for (i = 1; i <= n / 2; i++) + { + if (n % i == 0) + { + sum += i; + } + } + return sum == n; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc019.c b/Semester_1/practice-c/pc019.c @@ -0,0 +1,55 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps16 */ + +#include <stdio.h> +#include <math.h> + +int isArmstrong(int); + +int main() +{ + int num; + printf("Enter the number: "); + scanf("%d", &num); + if (isArmstrong(num)) + { + printf("\nInput %d is a Armstrong number.", num); + } + else + { + printf("\nInput %d is not a Armstrong number.", num); + } + return 0; +} + +int isArmstrong(int num) +{ + int temp = num; + int power = 0; + int result = 0; + while (temp > 0) + { + power++; + temp /= 10; + } + temp = num; + while (temp > 0) + { + result += (int)pow((temp % 10), power); + temp /= 10; + } + return result == num; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc020.c b/Semester_1/practice-c/pc020.c @@ -0,0 +1,45 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps3 */ + +#include <stdio.h> + +int series(int); + +int main() +{ + int n; + printf("Enter the n: "); + scanf("%d", &n); + printf("\nSum of the series: %d", series(n)); + return 0; +} + +int series(int n) +{ + int i, result = 0; + for (i = 1; i <= n; i++) + { + if (i % 2 == 0) + { + result -= i; + } + else + { + result += i; + } + } + return result; +}+ \ No newline at end of file diff --git a/Semester_1/practice-c/pc021.c b/Semester_1/practice-c/pc021.c @@ -0,0 +1,62 @@ +/* + * ====================================================================================== + * COPYRIGHT (C) 2026 AMIT DUTTA. ALL RIGHTS RESERVED. + * Repository : https://github.com/notamitgamer/bsc + * License : ESAL-1.0 ( https://aranag.site/license ) + * ====================================================================================== + * [ ACADEMIC INTEGRITY WARNING ] + * The use of this code for academic assignments at ANY educational institution, + * college, or university is STRICTLY PROHIBITED. + * Any other use requires prior written permission from the author. + * Violations will be reported as academic misconduct. + * ====================================================================================== + */ + +/* ps4 */ + +#include <stdio.h> +#include <math.h> + +int isPrime(int); + +int main() +{ + int n, i; + printf("Enter the number: "); + scanf("%d", &n); + if (isPrime(n)) + { + printf("\nInput %d is a prime number.", n); + } + else + { + printf("\nInput %d is not a prime number.", n); + } + printf("\nPrime numbers from 1 to 100:"); + for (i = 1; i <= 100; i++) + { + if (isPrime(i)) + { + printf(" %d", i); + } + } + return 0; +} + +int isPrime(int n) +{ + int i; + int end = (int)sqrt(n); + if (n == 0 || n == 1) + { + return 0; + } + for (i = 2; i <= end; i++) + { + if (n % i == 0) + { + return 0; + } + } + return 1; +}+ \ No newline at end of file diff --git a/docs/generate_index.py b/docs/generate_index.py @@ -6,7 +6,7 @@ import html REPO_URL = "https://github.com/notamitgamer/bsc" # List of directories to exclude from the list. -EXCLUDED_DIRS = ['.git', '.github', '.vscode', 'MinGW64', 'print', 'docs', '__pycache__'] +EXCLUDED_DIRS = ['.git', '.github', '.vscode', 'MinGW64', 'print', 'docs', '__pycache__', 'practice-c'] # List of files to exclude from the list. EXCLUDED_FILES = [ diff --git a/docs/index.html b/docs/index.html @@ -10839,753 +10839,6 @@ int main() <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" /> </svg> - <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">practice-c</span> - </div> - <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5"> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc001-c', 'pc001.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc001.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc001.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc001.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc001-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Pattern : - 1 - 1 2 - 1 2 3 - 1 2 3 4 - 1 2 3 4 5 -for n = 5 -*/ -/* Author - Amit Dutta, Date - 02nd October, 2025 */ - -#include <stdio.h> -int main() -{ - int i, j, num; - printf("Enter n : "); - scanf("%d", &num); - for (i = 1; i <= num; i++) - { - for (j = 1; j <= i; j++) - { - printf("%d\t", j); - } - printf("\n"); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc002-c', 'pc002.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc002.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc002.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc002.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc002-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Pattern : - 1 2 3 4 5 - 6 7 8 9 - 10 11 12 - 13 14 - 15 -for n = 5 -*/ - -/* Author - Amit Dutta, Date - 02nd NOVEMBER, 2025 */ - -#include <stdio.h> -int main() -{ - int i, j, n, temp = 1; - printf("Enter n : "); - scanf("%d", &n); - for (i = n; i >= 1; i--) - { - for (j = 1; j <= i; j++) - { - printf("%d\t", temp); - temp++; - } - printf("\n"); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc003-c', 'pc003.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc003.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc003.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc003.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc003-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Pattern : - 1 - 2 4 - 3 6 9 - 4 8 12 16 - 5 10 15 20 25 -for n = 5 -*/ - -#include <stdio.h> -int main() -{ - int i, j, n; - printf("Enter n : "); - scanf("%d", &n); - for (i = 1; i <= n; i++) - { - for (j = 1; j <= i; j++) - { - printf("%d\t", i * j); - } - printf("\n"); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc004-c', 'pc004.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc004.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc004.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc004.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc004-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Pattern : - 5 4 3 2 1 - 4 3 2 1 - 3 2 1 - 2 1 - 1 -for n = 5 -*/ - -#include <stdio.h> -int main() -{ - int i, j, k, n; - printf("Enter n : "); - scanf("%d", &n); - for (i = n; i >= 1; i--) - { - for (j = 1; j <= i - 1; j++) - { - printf("\t"); - } - for (k = i; k >= 1; k--) - { - printf("%d\t", k); - } - printf("\n"); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc005-c', 'pc005.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc005.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc005.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc005.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc005-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Pattern : - 1 - 1 2 - 3 5 8 - 13 21 34 55 - 89 144 233 377 610 -for n = 5 -*/ - -#include <stdio.h> -int main() -{ - int i, j, n; - long long temp1 = 0, temp2 = 1, temp3; - printf("Enter n : "); - scanf("%d", &n); - printf("1\n"); - for (i = 2; i <= n; i++) - { - for (j = 1; j <= i; j++) - { - temp3 = temp1 + temp2; - printf("%lld\t", temp3); - temp1 = temp2; - temp2 = temp3; - } - printf("\n"); - } - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc006-c', 'pc006.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc006.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc006.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc006.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc006-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Prime number check */ -/* Author - Amit Dutta, Date - 03rd NOVEMBER, 2025 */ - -#include <stdio.h> -#include <math.h> - -int main() -{ - int num, i, temp; - printf("Enter the number : "); - if(scanf("%d", &num) != 1) { - printf("Only postive number allowed."); - return 1; - } - if(num <= 0) { - printf("\nOnly potive number are allowed."); - return 1; - } - if(num == 1) { - printf("\nInput 1 is not a prime number."); - return 0; - } - if(num == 2) { - printf("\nInput 2 is a prime number."); - return 0; - } - if(num % 2 == 0) { - printf("\nInput %d is not a prime number.", num); - return 0; - } - temp = (int)sqrt(num); - for (i = 3; i <= temp; i += 2) - { - if (num % i == 0) - { - printf("\nInput %d is not a prime number.", num); - return 0; - } - } - printf("\nInput %d is a prime number.", num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc007-c', 'pc007.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc007.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc007.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc007.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc007-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Armstrong number check only for three digit */ -/* Author - Amit Dutta, Date - 03rd NOVEMBER, 2025 */ - -#include <stdio.h> - -int main() -{ - int num, temp1, armstrongCheck = 0; - printf("Enter a three digit number : "); - if (scanf("%d", &num) != 1) - { - printf("\nOnly positive number allowed."); - return 1; - } - if (num < 100 || num > 999) - { - printf("\nOnly Three digit postive number allowed."); - return 1; - } - temp1 = num; - while (temp1 > 0) - { - armstrongCheck += (temp1 % 10) * (temp1 % 10) * (temp1 % 10); - temp1 /= 10; - } - if (armstrongCheck == num) - printf("\nInput %d is a armstrong number.", num); - else - printf("\nInput %d is not a armstrong number.", num); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc008-c', 'pc008.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc008.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc008.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc008.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc008-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Factorial upto N */ -/* Author - Amit Dutta, Date - 03rd November, 2025 */ - -#include <stdio.h> - -int main() -{ - int n, i; - long long fact = 1; - printf("Enter n : "); - if (scanf("%d", &n) != 1) - { - printf("\nOnly non-negative number allowed."); - return 1; - } - if (n < 0) - { - printf("\nOnly non-negative number allowed."); - return 1; - } - if (n == 0) - { - printf("\nFactorial of 0 : 1"); - return 0; - } - for (i = 1; i <= n; i++) - fact *= i; - printf("\nFactorial of %d : %lld", n, fact); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc009-c', 'pc009.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc009.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc009.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc009.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc009-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Sum of digit */ -/* Author - Amit Dutta, Date - 04th November, 2025 */ - -#include <stdio.h> -int main() -{ - int num, sumOfDigit = 0, temp; - printf("Enter the number : "); - if (scanf("%d", &num) != 1) - { - printf("\nOnly a number is allowed."); - return 1; - } - temp = num; - while (temp > 0) - { - sumOfDigit += temp % 10; - temp /= 10; - } - printf("\nSum of the digit %d : %d", num, sumOfDigit); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc010-c', 'pc010.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc010.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc010.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc010.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc010-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Reverse a number */ -/* Author - Amit Dutta, Date - 04th November, 2025 */ - -#include <stdio.h> -int main() -{ - int num, temp, rev = 0; - printf("\nEnter the number : "); - if (scanf("%d", &num) != 1) - { - printf("\nOnly a number is allowed."); - return 1; - } - temp = num; - while (temp > 0) - { - rev = (rev * 10) + (temp % 10); - temp /= 10; - } - printf("\nReverse of the number %d : %d", num, rev); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc011-c', 'pc011.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc011.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc011.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc011.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc011-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C program that takes two positive integers, L (Lower Bound) -and U (Upper Bound), as input from the user. The program must find and print -the count of all numbers between L and U (inclusive) that -are also a Palindrome Number. */ -/* Author - Amit Dutta, Date - 11th November, 2025 */ - -#include <stdio.h> -#define true 1 -#define false 0 - -int isPalindrome(int num) -{ - int temp = num, numRev = 0; - while (temp > 0) - { - numRev = (numRev * 10) + (temp % 10); - temp /= 10; - } - if (num == numRev) - return true; - else - return false; -} - -int main() -{ - int uBound, lBound, num, palindromeCount = 0; - printf("Enter the Lower Bound and Upper Bound : "); - if (scanf("%d %d", &lBound, &uBound) != 2) - { - printf("\nOnly Integer values are allowed."); - return 1; - } - if (lBound < 0 || uBound < 0 || lBound > uBound) - { - printf("\nPlease enter appropriate inforamtion."); - return 1; - } - printf("Palindrome Numbers from %d to %d :", lBound, uBound); - for (num = lBound; num <= uBound; num++) - { - if (isPalindrome(num)) - { - printf(" %d", num); - palindromeCount++; - } - } - printf("\nTotal Palindrome number found inside the range (%d to %d) : %d", lBound, uBound, palindromeCount); - return 0; -}</div> - </div> - - <div class="file-item flex items-center justify-between px-3 py-2 hover:bg-white hover:shadow-sm rounded-lg transition-all group border border-transparent hover:border-slate-100 mb-1"> - <div class="flex items-center gap-2.5 min-w-0 cursor-pointer flex-1" onclick="showCode('code-Semester_1-practice-c-pc012-c', 'pc012.c', 'https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc012.c')"> - <svg class="w-4 h-4 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> - </svg> - <span class="text-sm text-slate-600 font-medium group-hover:text-blue-600 truncate">pc012.c</span> - </div> - <div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity"> - <a href="https://github.com/notamitgamer/bsc/blob/main/Semester_1/practice-c/pc012.c" target="_blank" class="p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded-md" title="View on GitHub"> - <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-2.126 1.029-2.935-.103-.253-.446-1.372.097-2.897 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.525.202 2.644.1 2.897.64.809 1.026 1.841 1.026 2.935 0 3.847-2.337 4.687-4.565 4.935.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg> - </a> - </div> - <!-- Embedded Code Storage --> - <div id="code-Semester_1-practice-c-pc012-c" style="display:none;">/* - * ====================================================================================== - * COPYRIGHT (C) 2025 AMIT DUTTA. ALL RIGHTS RESERVED. - * Repository : https://github.com/notamitgamer/bsc - * License : ESAL-1.0 ( https://amit.is-a.dev/license ) - * ====================================================================================== - * [ ACADEMIC INTEGRITY WARNING ] - * The use of this code for academic assignments at ANY educational institution, - * college, or university is STRICTLY PROHIBITED. - * Any other use requires prior written permission from the author. - * Violations will be reported as academic misconduct. - * ====================================================================================== - */ - -/* Write a C function that receives a string (character array) and uses -pointers to count and return the total number of vowels and consonants in that string. */ -/* Author: Amit Dutta, Date: 02-12-2025 */ - -#include <stdio.h> -#include <ctype.h> - -void charCounter(char[], int *, int *); - -int main() -{ - char str[101]; - int vowelCount, consonantCount; - printf("Enter the string (Max: 100 character): "); - if (fgets(str, sizeof(str), stdin) == NULL) - { - printf("Error reading input.\n"); - return 1; - } - charCounter(str, &vowelCount, &consonantCount); - printf("\nVowel Count: %d", vowelCount); - printf("\nConsonant Count: %d", consonantCount); - printf("\nTotal Character: %d", vowelCount + consonantCount); - return 0; -} - -void charCounter(char str[], int *vowelCount, int *consonantCount) -{ - int tempVowelCount = 0, tempConsonantCount = 0; - while (*str != '\0') - { - char ch = tolower(*str); - if (isalpha(ch)) - { - if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') - { - tempVowelCount++; - } - else - { - tempConsonantCount++; - } - } - str++; - } - - *vowelCount = tempVowelCount; - *consonantCount = tempConsonantCount; -}</div> - </div> - - </div> - </div> - - <div class="folder-container mb-2"> - <div class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-100 rounded-lg transition-colors group select-none" onclick="toggleFolder(this)"> - <svg class="chevron w-4 h-4 text-slate-400 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> - </svg> - <svg class="folder-icon w-5 h-5 text-blue-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" /> - </svg> <span class="font-medium text-slate-700 group-hover:text-blue-600 transition-colors">tuition-c</span> </div> <div class="hidden pl-4 mt-1 border-l-2 border-slate-100 ml-3.5">