Computer Science, asked by Bhavanavindamuri, 1 year ago

Hey guys....
Help me with this question....
Wrong will be reported and deleted....
Question is for only computers people....

Armstrong between number 100 to 200 using do-while


All the best!!!!


subhradip486: bhavana how you learn hindi?

Answers

Answered by aalaparunp66okp
0

#include <iostream.h>

#include<conio.h>

void main()

{

   int i = 101, rem, sum, tnum;

    cout<<" The three digit armstrong numbers between 100 and 200 are  : \n";

   do

   {

                tnum=i;

                sum=0;

                while(tnum>0)

                {

                            rem=tnum%10;

                            sum+=a*a*a;

                            tnum/=10;

                }

                if(i==sum)

                       cout<<i;

                i++;

    }

    while(i<200);

    getch();

}

Answered by venkyseela3112
0

#include<stdio.h>

#include<conio.h>

void main()

{

int n,c,d,s=0,num;

clrscr();

printf("\n Enter Any Number : ");

scanf("%d",&n);

num=n;

do

{

 d=n%10;

 c=d*d*d;

 s=s+c;

 n=n/10;

}while(n!=0);

if(s==num)

  printf("\n %d is Armstrong Number",num);

else

  printf("\n %d is Not an Armstrong Number",num);

getch();

}

Similar questions