1)write an algorithm to find the area of a rectangular using pseudocode
2)write an algorithm to find the mean of 5 numbers.
3)write an algorithm to find wether a given number is even or odd
1)
input: x,y \\width, length of a rectangular
"S:=x\\cdot y"
output: S \\ area of a rectangular
2)
input: "x_1, x_2,x_3,x_4,x_5" \\ 5 numbers
"m=\\frac{x_1+ x_2+x_3+x_4+x_5}{5}"
output: m \\ the mean of 5 numbers
3)
input: x \\ number
if ("x\\%2==0" ) \\ check whether a given number is divisible by 2
then otput: x is even
else output: x is odd
Comments
Leave a comment