bsc

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

commit 2b04cc009dbc91b2ca8452b88c6edc27bf955d19
parent d388ef9c8289cd1b6d7a6f99c2eadcd972a2805f
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Tue,  7 Oct 2025 21:26:04 +0530

new 29

Diffstat:
M.vscode/settings.json | 3++-
Aletusc/luc029.c | 30++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json @@ -59,6 +59,7 @@ "editor.inlineSuggest.enabled": false, "files.associations": { "math.h": "c", - "stdio.h": "c" + "stdio.h": "c", + "ratio": "c" } } \ No newline at end of file diff --git a/letusc/luc029.c b/letusc/luc029.c @@ -0,0 +1,29 @@ +/* Write a program to print out all Armstrong numbers between 100 +and 500. If sum of cubes of each digit of the number is equal to the +number itself, then the number is called an Armstrong number. For +example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3) */ +/* Author - Amit Dutta, Date - 7th OCT, 2025 */ +/* Let Us C, Chap- 5, Page - 87, Qn No.: B(b) */ + +#include <stdio.h> +#include <math.h> +int main() +{ + int num = 100, temp1, temp2, res; + printf("Armstrong numbers between 100 and 500 :"); + while (num <= 500) + { + temp1 = num; + res = 0; + while (temp1 != 0) + { + temp2 = temp1 % 10; + res = res + pow(temp2, 3); + temp1 = temp1 / 10; + } + if (num == res) + printf(" %d", num); + num++; + } + return 0; +}+ \ No newline at end of file
© 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