0% found this document useful (0 votes)
23 views

Number Program Using While Loop HW questions.-WPS Office

The document describes 12 different number programs: 1) A program to add the digits of a number. 2) A program to multiply the digits of a number. 3) A program to check if a number is a palindrome. 4) A program to check if a number is an Armstrong number. 5) A program to check if a number is a mean number. 6) A program to check if a number is a Niven number. 7) A program to check if a number is an automorphic number. 8) A program to find the largest digit of a number. 9) A program to find the smallest digit of a number. 10) A program to

Uploaded by

Sujata Sg
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Number Program Using While Loop HW questions.-WPS Office

The document describes 12 different number programs: 1) A program to add the digits of a number. 2) A program to multiply the digits of a number. 3) A program to check if a number is a palindrome. 4) A program to check if a number is an Armstrong number. 5) A program to check if a number is a mean number. 6) A program to check if a number is a Niven number. 7) A program to check if a number is an automorphic number. 8) A program to find the largest digit of a number. 9) A program to find the smallest digit of a number. 10) A program to

Uploaded by

Sujata Sg
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Number program

1.WAP for Sample input: 123

Output: 1+2+3

2. WAP for sample input: 123

Output:1*2*3

3. Write a program to check whether the given number is palindrome or not

Input: 121

Output: 121

4. Write a program to check whether the given number is Armstrong number or not

It is sum of cube of each digit.

Input: 153

5. WAP To check whether a given number is me on number or not

Input n=9, 9*9=81, 8+1=9.

It is the sum of square of numbers is equal to number itself.

6. Write a program to accept a number and check whether it is niven number or not.

It is a number which is divisible by its sum of its digits.

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: 25, 25*25=625

8. Write a program to find the largest digit of a given number

Input: 6594

Output: 9

9. Write a program to find the smallest digit of a given number


Input:6594

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

Output: duck number

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.

First 10 ugly numbers are 1,2,3,4,5,6,8,9,10,12.

You might also like