Pseudocode Questions
Pseudocode Questions
1. WAP to enter 10 numbers and find the total number of odd numbers and even numbers
entered by the user.
2. WAP to enter a 5 digit number(excluding 0) and count the number of odd digits and even
digits in the number.
3. WAP to enter a number to check if the number entered is a prime number or not.
1. WAP to enter a number and display all the factors of the number.
2. WAP to enter a number and check if the number is a Perfect number or not.
An example of a perfect number is 6. The sum of the factors of 6 excluding itself is 6, and
hence 6 is a perfect number.
6 : Factors of 6 are – 1, 2 , 3
Sum of the factors = 1+2+3=6
3. WAP to enter a number and find the factorial of that number.
4. WAP to enter the base and power (both positive numbers greater than 0 ) and find the value
of base raised to the power.
1. Write a program to enter ten numbers and at the end the program should display the largest
and smallest numbers entered.
2. WAP to enter a 5-digit number and print the reverse of the number.
3. WAP to check if a number is a palindrome or not. (3 digit number)
4. WAP to enter a 5-digit number and check if it is an Armstrong Number or not. The Armstrong
number is a number that is equal to the sum of cubes of its digits.
5. Write a program to calculate the sum of the following series where n is input by user.
1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
6. Compute the natural logarithm of 2, by adding up to n terms in the series
1 - 1/2 + 1/3 - 1/4 + 1/5 -... 1/n
where n is a positive integer and input by user.
08-08-2022
1. WAP to enter a number and count the number of odd digits, even digits and zeros in the
number.
2. Modify the above algorithm to accept a number with minimum 7 digits.
3. WAP to enter a number and print the reverse of the number.
4. WAP to check if a number is a palindrome or not.
5. WAP to enter a number and check if it is an Armstrong Number or not. The Armstrong
number is a number that is equal to the sum of cubes of its digits.
6. WAP to enter a number and check whether the number is ‘Neon’ or not. A number is said to
be Neon, if the sum of the digits of the square of a number is equal to the number itself.
Example: 9
9. Study the given pseudocode and answer the questions that follow
NEW_NO=0
output ”Enter the Number: ”
input N
X=1
loop while N>0
R= N mod 10
if R ≠ 0 then
NEW_NO = (R * X) + NEW_NO
X = X * 10
end if
N = N div 10
end loop
output NEW_NO
a. Complete the trace table given the given input N= 5400201