Answer to Question #251631 in C for jhg

Question #251631

Write an assembly language program that uses 3 byte variables, a, b, and c. The variable are initialized before the program starts with the values 2, 5, and 0, respectively. The program will add, sub, divide and multiply the contents of the variable a to that of b and store the result into c. Only c will change.


1
Expert's answer
2021-10-15T03:07:34-0400
#include <stdio.h>
int a=2;
int b=5;
int c=0;
int main()
{
    c=a+b;
    printf("Addition: %d\n",c);
    int subtract=b-a;
    c=b-a;
    printf("Subtraction: %d\n",c);
    double divide=b/a;
    c=b/a;
    printf("Division: %.2f\n",divide);
    c=b*a;
    printf("Multiplication: %d\n",c);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS