The square root of a number can be calculated by repeated subtraction method provided the number is an integer square number. In repeated subtraction method successive odd numbers are subtracted from the given whole square number until zero is obtained. Then the total quantity of numbers which are subtracted in all steps are the square root of that number. The Octave code for calculating the square root of 100 and 169 is given below.
Octave code:
function sqrroot = sqrrootbyrepetativesub(number)
i=1; sqrroot = 0;
while number ~= 0
number = number - i;
sqrroot = sqrroot + 1;
i = i+2;
end
endfunction
Now, calling the function with numbers 100 and 169 the square roots are obtained.
Output:
>> sqrroot = sqrrootbyrepetativesub(100)
sqrroot = 10
>> sqrroot = sqrrootbyrepetativesub(169)
sqrroot = 13
MyAssignmenthelp.com offers best thesis writing service in USA. We offer the right platform for those who often search can anyone help me write a thesis perfectly. With a pool of qualified and experienced online thesis makers, we provide highest quality PHD thesis writing services to students in USA. Our PhD thesis help services include writing help, help with selecting topics, assistance for researching and editing and proofreading help.
Just share requirement and get customized Solution.
Orders
Overall Rating
Experts
Our writers make sure that all orders are submitted, prior to the deadline.
Using reliable plagiarism detection software, Turnitin.com.We only provide customized 100 percent original papers.
Feel free to contact our assignment writing services any time via phone, email or live chat. If you are unable to calculate word count online, ask our customer executives.
Our writers can provide you professional writing assistance on any subject at any level.
Our best price guarantee ensures that the features we offer cannot be matched by any of the competitors.
Get all your documents checked for plagiarism or duplicacy with us.
Get different kinds of essays typed in minutes with clicks.
Calculate your semester grades and cumulative GPa with our GPA Calculator.
Balance any chemical equation in minutes just by entering the formula.
Calculate the number of words and number of pages of all your academic documents.
Our Mission Client Satisfaction
Thank you for a very well written discussion post and looking forward to continue working with this expert
Australia
Very affordable prices and quick response from the customer service team very well written highly recommended
Australia
assignment was good would refer anyone to use you all when it comes to assiting with assignment
Australia
Very good and fulfilled the requirements. l will return for other assignments. Thank you
Australia