commit 2f6e9729b2252990d636420bd3339a6ea4c44819
parent 35860fe40d62dd8fe8763b987f61c518789c1806
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Wed, 10 Dec 2025 20:03:29 +0530
[2025-12-10] .\c\..\ : Deleted the old 'c' folder and introduced 'assignment-secondary' containing the updated assignment files.
Diffstat:
21 files changed, 0 insertions(+), 196 deletions(-)
diff --git a/c/1.c b/c/1.c
@@ -1,29 +0,0 @@
-// Write a program (WAP) to print the sum and product of digits of an integer.
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-
-int main() {
- int inp, result_sum = 0, result_product = 1, temp;
- printf("Please enter the number : ");
- scanf("%d",&inp);
- printf("\n");
-
- if (inp < 0) {
- printf("\nPlease enter a valid non negetive integer.");
- return 1;
- }
-
- temp = inp;
- while (temp != 0 ) {
- result_sum = result_sum + (temp % 10);
- result_product = result_product * (temp % 10);
- temp = temp / 10;
- }
-
- printf("\nSum of the digits of the input number '%d' is : %d"
- "\nProduct of the digits of the input number '%d' is : %d",
- inp, result_sum, inp, result_product);
- return 0;
-}
-
diff --git a/c/1.exe b/c/1.exe
Binary files differ.
diff --git a/c/2.c b/c/2.c
@@ -1,26 +0,0 @@
-//WAP to reverse a non-negative integer.
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-
-int main() {
- int inp, result = 0, temp;
- printf("PLease enter the number you want to reverse : ");
- scanf("%d",&inp);
- printf("\n");
-
- if (inp < 0) {
- printf("\nPlease enter a non negetive integer.");
- return 1;
- }
-
- temp = inp;
- while ( temp != 0) {
- result = (result * 10) + (temp % 10);
- temp = temp / 10;
- }
-
- printf("\nReverse of the input '%d' is : %d", inp, result);
- return 0;
-}
-
diff --git a/c/2.exe b/c/2.exe
Binary files differ.
diff --git a/c/3.c b/c/3.c
@@ -1,24 +0,0 @@
-// WAP to compute the sum of the first n terms of the following series S =1+1/2+1/3+1/4+......
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-
-int main() {
- int n, i;
- float result = 0;
- printf("Please enter the value for 'n' : ");
- scanf("%d", &n);
- printf("\n");
-
- if (n <= 0) {
- printf("\nPlease enter a positve number greater than ZERO.");
- return 1;
- }
-
- for (i = 1; i <= n; i++) {
- result = result + (1.0 / i);
- }
-
- printf("\nSum of the first %d terms of the following series S =1+1/2+1/3+1/4+...... is : %f",n,result);
- return 0;
-}
diff --git a/c/3.exe b/c/3.exe
Binary files differ.
diff --git a/c/4.c b/c/4.c
@@ -1,27 +0,0 @@
-//WAP to compute the sum of the first n terms of the following series,S =1-2+3-4+5......
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-
-int main() {
- int n, result = 0, temp, i;
- printf("Please enter the value for 'n' for this series 's = 1-2+3-4+5-....': ");
- scanf("%d",&n);
- printf("\n");
-
- if (n <= 0) {
- printf("\nPlease enter a positive integer.");
- return 1;
- }
-
- for (i = 1; i<= n; i++) {
- if (i % 2 == 0) {
- result = result - i;
- }
- else {
- result = result + i;
- }
- }
-
- printf("\nAns : %d", result);
-}
diff --git a/c/4.exe b/c/4.exe
Binary files differ.
diff --git a/c/5.c b/c/5.c
@@ -1,34 +0,0 @@
-/*Write a function to find whether a given no. is prime or not.
-Use the same to generate the prime numbers less than 100.*/
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-
-int isPrime(int inp) {
- int i, is_prime = 1;
-
- if (inp < 2) is_prime = 0;
-
- for (i = 2; i <= inp / 2; i++) if (inp % i == 0) {
- is_prime = 0;
- break;
- }
-
- return is_prime;
-}
-
-
-int main() {
- int inp, i;
- printf("Enter the number you want to check : ");
- scanf("%d",&inp);
- printf("\n");
-
- if (isPrime(inp)) printf("\nGiven input '%d' is a Prime Number.",inp);
- else printf("\nGiven input '%d' is not a Prime Number.",inp);
-
- printf ("\nSeries of prime number upto 100 : ");
- for (i = 2; i < 100; i++) if (isPrime(i)) printf(" %d",i);
-
- return 0;
-}
diff --git a/c/5.exe b/c/5.exe
Binary files differ.
diff --git a/c/6.c b/c/6.c
@@ -1,31 +0,0 @@
-/*Write a function that checks whether a given string is Palindrome or not.
-Use this function to find whether the string entered by the user is Palindrome or not.*/
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-#include<string.h>
-
-int isPalindrome(char inp[]) {
- int len = strlen(inp);
- int i = 0; //starting point
- int j = len - 1; //end point
-
- while (i < j) {
- if (inp[i] != inp[j]) {
- return 0;
- }
- i++;
- j--;
- }
-
- return 1;
-}
-
-int main() {
- char inp[20];
- printf("Enter the number : ");
- scanf("%s",inp);
- if (isPalindrome(inp)) printf("\n\nInput '%s' is a Palindrome number.", inp);
- else printf("\n\nInput '%s' is not a Palindrome number.", inp);
- return 0;
-}
diff --git a/c/6.exe b/c/6.exe
Binary files differ.
diff --git a/c/7.c b/c/7.c
@@ -1,25 +0,0 @@
-// WAP to compute the factors of a given number
-// Author - Amit Dutta, Date - 13th SEP, 2025
-
-#include<stdio.h>
-#include<stdlib.h>
-
-int main() {
- int inp, num, i;
- printf("Please enter the number to get the factors from it : ");
- scanf("%d", &inp);
-
- num = abs(inp);
-
- if (num == 0) {
- printf("\n\n0 has infinitely many factors (all integers).");
- return 1;
- }
-
- printf("\n\nThe factors of ' %d ' is :- ", inp);
- printf("\nPositive : ");
- for (i = 1; i <= num ; i++) if (num % i == 0) printf(" %d", i);
- printf("\nNegative : ");
- for (i = 1; i <= num ; i++) if (num % i == 0) printf(" %d", -i);
- return 0;
-}
diff --git a/c/7.exe b/c/7.exe
Binary files differ.
diff --git a/c/codesnapshot/1.png b/c/codesnapshot/1.png
Binary files differ.
diff --git a/c/codesnapshot/2.png b/c/codesnapshot/2.png
Binary files differ.
diff --git a/c/codesnapshot/3.png b/c/codesnapshot/3.png
Binary files differ.
diff --git a/c/codesnapshot/4.png b/c/codesnapshot/4.png
Binary files differ.
diff --git a/c/codesnapshot/5.png b/c/codesnapshot/5.png
Binary files differ.
diff --git a/c/codesnapshot/6.png b/c/codesnapshot/6.png
Binary files differ.
diff --git a/c/codesnapshot/7.png b/c/codesnapshot/7.png
Binary files differ.