Hedi 10
Hedi 10
Start
Declare variables
N1,N2
False True
If A>B
Print B Print A
Stop
2) Calculate the average of three numbers:
Start
Declare variable
A ,B,C and sum
Sum=(A+B+C)/3
Display
Stop
2) Check if a number is Even odd:
Start
Declare variable
number
Read Value
number
False If True
N%2=0
End
3) Sum of number list:
Step1: Star
Step2: declare variable list sum,i
Step3: initialize variables i=1
Step4: read value list
i= list*length
4.1 sum list[i]+sum
4.2 i= 1+i
Step5: Display sum
Step6: Stop
4)factorial calculation :
Start
Fact=1,i=1
False
I<=num
true
Fact=fact*i
i=1+i
Stop
6) check for prime numbers:
Start
Read value n
i=2
F
i<n
I%n==0 T
i=1+i
T F
i==n
Stop
7) convert Celsius to fehrenheit and vica versa:
Start
Initialize f=0
F=(9\5*C)+32
Stop
8) swap two numbers:
Step1: Start
Step2: Read the value of a, b
Step3: a = a + b
b=a-b
a=a-b
Step4: Print the value of a and b
Step5: Stop
Start
Area = length*breadth
Display Area
Stop
:find the square root of a number )10
start
false If true
A_number>=0
stop
11) check leap year:
stop
Year %4==0
true false
Year%100==0
Year%400==0
Leap year
Not leap year
Stop
: calculate percentage of passed students )12
step 1: start
step 2: read marks m1, m2, m3
step 3: calculate sum = m1+m2+m3
step 4: calculate per=(sum/3)*100
step 5: display sum, per
step 6: stop
Output: x*n
2.p← 1
4. p← p.x
5.Return p
6. End Procedure
14) Find if a given character is vowel:
Start
false true
Stop