This program is about check using for loop and if conditions and print armstrong numbers between 100 to 999 in array
#include<stdio.h> int main() { int i,j=0,n=999,m[1000],a,b,c,d,e; printf("\nArmstromg number betweeen 100 to 999 are:"); for(i=100;i<n;i++) { a=i/10; b=i%10; c=a/10; d=a%10; b=b*b*b; c=c*c*c; d=d*d*d; e=b+c+d; if(i==e) { j++; printf("\nm[%d]=%d",j,i); } } printf("\nTotal number of amstrong no's=%d",j); return 0; }To download raw file Click Here
Armstrong number between 100 to 999 m[1]=153 m[2]=370 m[3]=371 m[4]=407 Total number of armstrong no's=4
Learn All in Tamil © Designed & Developed By Tutor Joes