Number Program Using While Loop HW questions.-WPS Office
Number Program Using While Loop HW questions.-WPS Office
Output: 1+2+3
Output:1*2*3
Input: 121
Output: 121
4. Write a program to check whether the given number is Armstrong number or not
Input: 153
6. Write a program to accept a number and check whether it is niven number or not.
7. Write a program to accept the number to check whether it is automorphic number or not.
Automorphic number is the number in which the original number is contained in the last two digit of its
square.
Input: 6594
Output: 9
Output:4
10. Write a program to check whether the given number is duck number or not.
If a number contains one or more gross but does not start with zero is called duck number.
Input: 2405
11. Write a program to check whether the given number is spy number or not.
Spy number is a number where the sum of its digits is equal to the product of its digits.
Input: 1124
1+1+2+4=8
1*1*2*4=8
12. Write a program to check whether the given number is ugly number or not.
Ugly number are positive numbers whose only prime factors are 2,3,5.