Computer Science, asked by tammu4355, 1 year ago

Write a program to find the sum of a series of 8 bit numbers

Answers

Answered by Anonymous
0
First give a meaningful name to the recursive function to print even odd numbers. Let's say printEvenOdd(). This function can print both even as well as odd numbers in given range.

Next the function must accept two inputs i.e. the current number to print and the upper limit. Hence, update the function declaration to printEvenOdd(int cur, int limit);.

Finally, the function prints all even or odd numbers in given range and returns void.

So, the final function declaration to print even or odd numbers is - void printEvenOdd(int cur, int limit);

Answered by Anonymous
1

In order to find the sum of numbers, first, the counter must be initialized with the size of an array and accumulator must be initialized to zero. Then, the first number is moved to register B and added with the accumulator. After addition, the counter is decremented and checked whether it has reached zero.

Similar questions