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

Pseudocode Practice Question

Uploaded by

ragdahahmed00
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)
5 views

Pseudocode Practice Question

Uploaded by

ragdahahmed00
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/ 1

Example – 1: Write an algorithm to print given number is even or odd

i. input: num
ii. if num % 2== 0 then
iii. print(‘number is even’)
iv. else:
v. print(‘number is odd’)
[end if]
vi. exit

Example – 2: Write an algorithm to find the solution of quadratic equations

// quadratic equation ax2 + bx + c = 0


i. inputs: a, b, c
ii. D = b2 – 4ac
iii. if D < 0 then
print(‘solution not possible’)
iv. else:

1=

2=

Print(x1, x2)
v. exit

Example – 3: Write pseudocode to convert a temperature from Fahrenheit to Celsius using


C = (F − 32 )/1.8 . If the temperature is between 0°C and 10°C, print "cold." If the temperature is between
10°C and 20°C, print "weather is pleasant." If the temperature is 20°C or higher, print "weather is warm."

Example – 4: Write pseudocode to generate a mathematical table using a for loop. The inputs include the
number for the table and the stopping value.

Example – 5: Write an algorithm to calculate the cumulative sum of first n natural numbers.

Example – 6: You have to plan buy a mobile new mobile phone, write an algorithm using loop and
condition the whole process from beginning to end of the process. Indicate the input, output, and process.

You might also like