Pseudocode Practice

You might also like

You are on page 1of 1

1.

Factors of a number

Start
Input n
Loop i from 1 to n
If n%i = 0 then
Display i
Enid if
End loop

2. Roots of a quadratic equation

Start
Input a, b, c
Output( -b+ sqrt(b^2-4ac))/2a and ( -b- sqrt(b^2-4ac))/2a)

3. Odd numbers from 1 to 100

Start
I=1
While i<100
Display i
i+=2
close while

4. Find the sum of series


Input N
Sum = 0, I = 1
Loop I from 1 to N
If i%2!=0
Sum = sum + i
End Loop
Output sum
5. Fibonacci series till 50
6. Create an array of size 10 and assign random values to each element of the array
and print. Use the function random() to assign random values.

You might also like