0% found this document useful (0 votes)
54 views2 pages

Pseudocode Questions

The document contains pseudocode questions assigned on different dates for a programming course. The questions cover a range of topics including finding factors of numbers, checking for perfect, prime and palindrome numbers, calculating factorials, reversing digits, and determining the number of odd/even/zero digits. Later questions focus on checking for Armstrong, Neon and Duck numbers as well as calculating logarithms and digit frequencies. An example pseudocode is provided to remove zeros from a number along with a trace table to trace its execution.

Uploaded by

Aryan Shah
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)
54 views2 pages

Pseudocode Questions

The document contains pseudocode questions assigned on different dates for a programming course. The questions cover a range of topics including finding factors of numbers, checking for perfect, prime and palindrome numbers, calculating factorials, reversing digits, and determining the number of odd/even/zero digits. Later questions focus on checking for Armstrong, Neon and Duck numbers as well as calculating logarithms and digit frequencies. An example pseudocode is provided to remove zeros from a number along with a trace table to trace its execution.

Uploaded by

Aryan Shah
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
You are on page 1/ 2

Pseudocode questions done on 01-08-2022- B4/B6

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.

Pseudocode questions done on 02-08-2022- B4/B6

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.

Pseudocode questions done on 03-08-2022- B4/B6

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*9 = 81 = 8+1=9, hence 9 is a Neon Number


7. WAP to accept a number and display the frequency of each digit present in the number.
8. WAP to accept a number and check whether the number is Duck or not. A number is said to
be a duck if it contains 0 in it.

Sample input - 34094

output - It is a Duck Number

Sample input - 6576

output - it is not a duck number

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

N X if N>0 R NEW_NO Output

b. State the purpose of the pseudocode.


print the new number removing the zeros

You might also like