Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

TEC217 Assign5 Compatibility Mode-Word ictor Fomc Layout References Mailings Rev

ID: 3605813 • Letter: T

Question


TEC217 Assign5 Compatibility Mode-Word ictor Fomc Layout References Mailings Revien iew POF Reader TO ACROBAT L. Describe, step-by-step, what the Litle Man does to execute an UN CODITIONAL BRANCH instruction f a user wants to euter two aumbers, what must the Little Man program do before she enters the second number? Why? 2· I 3. Write a Litfe Man program that accepts two numbers as ioput and outputs the oumbers in reverse order 4. Even if he runs out of instructions to execule, the Little Man only stops trying to execute instructions under one condition. What is that condition? What happens if the Litle MD runs out of instructions and that condition is not met?

Explanation / Answer

UNCONDITIONAL CONTROL STATEMENT:


The syntax of goto statement is:

Points to remember about goto statement:

Execute Uncoditional Branch:

2. Before Entering the second number, Little Man has to press ENTER keyword. This tell the compiler that till here, I was typing the first number. Here ENTER keyword works as terminator.

3.

#include <stdio.h>

int reversDigits(int num)
{
    int rev_num = 0;
    while(num > 0)
    {
        rev_num = rev_num*10 + num%10;
        num = num/10;
    }
    return rev_num;
}

int main(void) {
   // your code goes here
   int firstNumber, secondNumber;
  
   scanf("%d%d", &firstNumber, &secondNumber);
  
   printf("%d %d ", reversDigits(firstNumber), reversDigits(secondNumber));
  
   return 0;
}

goto END:   
................
................
................  
END:
.................