bsc

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

commit 52a2ad3a1299264c3f67893ca9f0db394f340692
parent 162bd8e0fa03d406f5fa66391710d7e4a51e12d4
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Sun,  7 Sep 2025 19:35:58 +0530

Add files via upload
Diffstat:
Atution-c/1.c | 28++++++++++++++++++++++++++++
Atution-c/1.exe | 0
2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/tution-c/1.c b/tution-c/1.c @@ -0,0 +1,28 @@ +// Write a program (WAP) to print the sum and product of digits of an integer. + +#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/tution-c/1.exe b/tution-c/1.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