Question

Write a Turing program that computes addition of natural numbers. What do you need to define...

Write a Turing program that computes addition of natural numbers. What do you need to define first?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer Part 1 :

var x : real

var y : real

put " Enter the Range of natural numbers for calculating sum

put "Enter first natural number "

get x

put "Enter last natural number"

get y

var i : real

i =0

for count : x .. (y+1)

i=i+x

end for

put "The sum of natural number ranging from", x, "and", y, "is", i

Answer Part 2 : we need to define firstly the variables which we use in our solutions and then we will run for loop under which we are summing up the numbers between the range

Add a comment
Know the answer?
Add Answer to:
Write a Turing program that computes addition of natural numbers. What do you need to define...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT