Answer to Question #259336 in C for Mr Z

Question #259336

1. Using the online compiler (or Dev C++):-

• Enter the code from the file operators.c https://vle.dmu.ac.uk/bbcswebdav/pid-5463722-dt-content-rid-10886002_1/courses/ENGD1025_2122_520/operators%281%29.c

• Add this source code to your logbook.

• Run the program. You will be prompted to enter integer values for a and b. Enter 4 for a, and 5 for b.

• Add the output of this program to your logbook

• Write a short reflective account of the code concentrating on its functionality and comparing the outputs against the source code.


1
Expert's answer
2021-11-01T18:51:18-0400


#include <stdio.h>


int main()
{
    //declare a and b variables
    int a; 
    int b;
    
    //enter the value of a
    printf("\nEnter a: ");
    scanf("%d",&a);
    //enter the value of a
    printf("\nEnter b: ");
    scanf("%d",&b);
    
    int sum;
    sum=a+b;
    printf("\nThe sum of %d and %d = %d",a,b,sum);
    
    //a=4; b=5
    //Output
    //The sum of a and 5 = 9


    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