COMPUTATIONAL THINKING
By
Dept. of CSE
PVPSIT, Kanuru.
PRASAD V. POTLURI SIDDHARTHA INSTITUTE OF TECHNOLOGY
Dept. of CSE
2025 - 26
FINDING THE SQUARE ROOT OF A NUMBER
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
From these examples we can conclude that in the general case the square root on n, of another number m must satisfy the equation
PVPSIT (Autonomous)
Problem Solving Techniques
1. Choose a number n less than the number m we want the square root of.
2. square n and if it is greater than m decrease n by 1 and repeat step 2, else go to step 3.
3. When the square of our guess at the square root is less than m we can start increasing n by 0.1 until we again compute a guess greater than m. At this point, we start decreasing our guess by 0.01 and so on until we have computed the square root we require to the desired accuracy.
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
begin
read m
set e
set g2:=m/2
do
begin
g1:=g2
g2:=(g1+g2/2)
while(abs(g1-g2)>=e)
end
writeout(g2)
end
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques
Dept. of CSE
2025 - 26
PVPSIT (Autonomous)
Problem Solving Techniques