Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
armstrong number using a while loop
//gcc 5.4.0 #include <stdio.h> int main(void) { int number, originalNumber, remainder, result = 0; printf("Enter a three digit integer: "); scanf("%d", &number); originalNumber = number; while (originalNumber != 0) { remainder = originalNumber%10; result += remainder*remainder*remainder; originalNumber /= 10; } if(result == number) printf("%d is an Armstrong number.",number); else printf("%d is not an Armstrong number.",number); return 0; }
run
|
edit
|
history
|
help
0
merge two dice clay to head sport green globe attacked me seven of prime minister fired
TAREA M4 - LOTERIA
C_141210_Tartaglia
C programming example for a Person struct and typedef (from ECE 2534)
strcopy
SOLUCION USANDO UN CICLO Y PUNTERO
18BCE2182 ASSESS_1 Q1-6
13
problem4 review fundamentos
CO Assignment 1 Question 4