bsc

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

commit 9251fbe535b56ce020f8e12d2305a12778c2bf48
parent 3c39457d1a10490ec6b2b81183114fb82108f99f
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Tue,  2 Sep 2025 10:45:08 +0530

Add files via upload
Diffstat:
Apractice-c/factorial.c | 24++++++++++++++++++++++++
Apractice-c/factorial.exe | 0
Apractice-c/findlargestsmallest.c | 40++++++++++++++++++++++++++++++++++++++++
Apractice-c/findlargestsmallest.exe | 0
Apractice-c/reversepalindrome.c | 31+++++++++++++++++++++++++++++++
Apractice-c/reversepalindrome.exe | 0
Apractice-c/sumofdigit.c | 18++++++++++++++++++
Apractice-c/sumofdigit.exe | 0
8 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/practice-c/factorial.c b/practice-c/factorial.c @@ -0,0 +1,24 @@ +#include<stdio.h> + +int main() { + int inp, result = 1, i; + printf("Enter the number to get the factorial : "); + scanf("%d",&inp); + + if (inp < 0 ) { + printf("\nPlease enter a valid integer. (eg. 1,5)"); + return 0; + } + + if (inp == 0) { + printf("\nFactorial of 0 : 1"); + return 0; + } + + for (i = 1; i <= inp; i++) { + result = result * i; + } + + printf("\nFactorial of %d : %d",inp, result); + return 0; +} diff --git a/practice-c/factorial.exe b/practice-c/factorial.exe Binary files differ. diff --git a/practice-c/findlargestsmallest.c b/practice-c/findlargestsmallest.c @@ -0,0 +1,40 @@ +#include<stdio.h> + +int main() { + int input_count, inp, max, min, i; + printf("\nHow many input do you want to add to the array : "); + scanf("%d",&input_count); + + if (input_count <= 0) { + printf("\nArray should have atleast 1 value."); + return 0; + } + + printf("\n"); + int values[input_count]; + + for (i = 0; i < input_count; i++) { + printf("Please enter value for position %d : ", i+1); + scanf("%d",&inp); + + if (inp < 0) { + printf("\nPlease enter a non negetive integer."); + return 0; + } + + values[i] = inp; + } + + max = values[0]; + min = values[0]; + + for (i = 0; i < input_count; i++) { + if (max < values[i]) max = values[i]; + if (min > values[i]) min = values[i]; + } + + printf("\nMaximum : %d",max); + printf("\nMinimum : %d",min); + return 0; +} + diff --git a/practice-c/findlargestsmallest.exe b/practice-c/findlargestsmallest.exe Binary files differ. diff --git a/practice-c/reversepalindrome.c b/practice-c/reversepalindrome.c @@ -0,0 +1,31 @@ +#include<stdio.h> +#include<conio.h> +int main() { + int inp, reverse_inp = 0; + printf("Enter a Number : "); + scanf("%d",&inp); + + if (inp <= 0) { + printf("\nInput cannot be Zero or Below Zero. \nYour Input was : %d",inp); + } + + else { + int temp1 = inp, temp2, temp3; + while (temp1 != 0) { + temp2 = temp1 / 10; + temp3 = temp1 % 10; + temp1 = temp2; + + reverse_inp = (reverse_inp * 10) + temp3; + } + printf("\nReverse of the input %d is : %d",inp,reverse_inp); + } + + if (inp == reverse_inp) { + printf("\nInput number %d is a Palindrome number.",inp); + } + + else { + printf("\nInput number %d is not a Palindrome number.",inp); + } +} diff --git a/practice-c/reversepalindrome.exe b/practice-c/reversepalindrome.exe Binary files differ. diff --git a/practice-c/sumofdigit.c b/practice-c/sumofdigit.c @@ -0,0 +1,18 @@ +#include<stdio.h> +#include<conio.h> + +int main() { + int input_count, inp, result = 0, i; + printf("Please enter how many number you want to add : "); + scanf("%d",&input_count); + printf("\n"); + + for (i = 1; i <= input_count; i++) { + printf("Please enter the number %d : ",i); + scanf("%d",&inp); + result = result + inp; + } + + printf("\nResult : %d",result); + return 0; +} diff --git a/practice-c/sumofdigit.exe b/practice-c/sumofdigit.exe Binary files differ.
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror