0% found this document useful (0 votes)
4 views3 pages

Number Programs and Calculations

The document outlines a series of programming tasks focused on number manipulation, including finding factors, digits, and various properties of numbers. Each task requires the implementation of a program to read a number and perform calculations or checks, such as identifying prime factors, counting digits, and determining if a number is prime or a palindrome. The tasks are structured into different categories, with specific requirements for each program.

Uploaded by

abhishekjalan30
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Number Programs and Calculations

The document outlines a series of programming tasks focused on number manipulation, including finding factors, digits, and various properties of numbers. Each task requires the implementation of a program to read a number and perform calculations or checks, such as identifying prime factors, counting digits, and determining if a number is prime or a palindrome. The tasks are structured into different categories, with specific requirements for each program.

Uploaded by

abhishekjalan30
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NUMBER PROGRAMS

Q1. WAP to read any number and print:-


i) all factors of a number
ii) all even factors of a number
iii) all odd factors of a number
iv) all prime factors of a number
Q2. WAP to read any number, count and print:-
i) total factors of a number
ii) total even factors of a number
iii) total odd factors of a number
iv) total prime factors of a number
Q3. WAP to read any number, calculate and print:-
i) sum of factors of a number
ii) sum of even factors of a number
iii) sum of odd factors of a number
iv) sum of prime factors of a number
Q4. WAP to read any number, calculate and print:-
i) product of factors of a number
ii) product of even factors of a number
iii) product of odd factors of a number
iv) product of prime factors of a number
Q5. WAP to read any number, calculate and print:-
i) average of all factors of a number
ii) average of even factors of a number
iii) average of odd factors of a number
iv) average of prime factors of a number
Q6. WAP to read any number of 2 or more digits, and print:-
i) all digits of a number
ii) all even digits of a number
iii) all odd digits of a number
iv) all prime digits of a number
Q7. WAP to read any number, count and print:-
i) total digits of a number
ii) total even digits of a number
iii) total odd digits of a number
iv) total prime digits of a number
Q8. WAP to read any number, calculate and print:-
i) sum of all digits of a number
ii) sum of even digits of a number
iii) sum of odd digits of a number
iv) sum of prime digits of a number
Q9. WAP to read any number, calculate and print:-
i) average of all digits of a number
ii) average of even digits of a number

1|Page
iii) average of odd digits of a number
iv) average of prime digits of a number
Q10. WAP to input any number of 2 or more digits and print:-
i) all digits in ascending order without using any sorting technique
sample input:- 5271
sample output:- 1257
ii) all digits in descending order without using any sorting technique
sample input:- 5271
sample output:- 7521
iii) digits in ascending order by removing all duplicate digits
sample input:- 5217421
sample output:- 12457
iv) digits with it’s frequency
sample input:- 5217421
Sample output:- digit frequency
1 2
2 2
4 1
5 1
7 1
//number program
Q11. WAP to input any number. Check and print:-
i) Prime or not?
ii) Composite or not?
i) Perfect or not?
ii) Triangular or not?
iii) Palindrome or not?
iv) Armstrong or not?
v) Special or not?
vi) Auto morphic or not?
vii) Tri morphic or not?
viii) Keprakar or not?
ix) Magic or not?
x) Happy or not?
xi) Composite magic or not?
xii) Super palindrome or not?
xiii) Mysterious or not?
xiv) Smith or not?
xv) Niven or not?
xvi) Buzz or not?
xvii) Spy number or not?
xviii) Harshad number or not?
xix) Increasing order number or not?
xx) Decreasing order number or not?
xxi) Bouncy number or not?
xxii) Prime palindrome or not?

2|Page
xxiii) Disarium or not?
xxiv) Keith number or not?

3|Page

You might also like