Wednesday, 1 February 2017

11C-Prg-20. Write a Algorithim and Program to find a given number is Angstrom or not.




  Write a Algorithim and Program to find a given number is Angstrom or not.
  Algorithim:
        Input:
    1.      Num 
Output 
1.      The Num is Armstrong or not
Method:
1.     Start
2.    .  Read Num
3.      Print Num
4.       //logic
T=Num;
Sum=0;
While(Num != 0)
{
    Rem = Num % 10;
    Cub = pow(Rem,3);
    Sum=Sum + Cub;
    Num = Num /10;
}
if (Sum = = T)
    Print “ The given no is Armstrong”;
else
    Print” The given no is not Armstrong”;
5.    .  Stop

No comments:

Post a Comment