C Program to Check Armstrong Number

#include <stdio.h>

#include<conio.h>

void main() {

    int n, on, rem, res = 0;

    clrscr();

    printf("Enter Number\n ");

    scanf("%d", &n);

    on = n;

    while (on != 0) 

   {

             rem = on % 10;

             res = res+rem * rem * rem;

             on = on/10;

    }

    if (res == n)

        printf("%d is an Armstrong number.", n);

    else

        printf("%d is not an Armstrong number.", n);

   getch();

}