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

Write a C program that will do the following: 1.Declare four integers variables.

ID: 3747015 • Letter: W

Question

Write a C program that will do the following:

1.Declare four integers variables.   intVar1, intVar2, intVar3,and intVar4.

2. Initialize intVar1 to the value 4; initialize intVar2to the value 5.

3. Declare four more integer variables. exp1, exp2,exp3, and exp4.

4. Declare a character variable charVar.

5. Assign the value of each expression below to variables exp1and exp2 respectively:

exp1= intVar1 + ((5 * intVar2) / (3 * intVar1));

exp2 = intVar1 + (5 * (intVar2 / 3)) * intVar1;

6. Using the fprintf()function, print to standard output the values of the variables (your output should look like the following):

intVar1= 4 and intVar2 = 5

Expression values are: exp1 = 6 exp2 = 24

Explanation / Answer

#include int main() { //1.Declare four integers variables. intVar1, intVar2, intVar3,and intVar4. int intVar1, intVar2, intVar3, intVar4; //2. Initialize intVar1 to the value 4; initialize intVar2 to the value 5. intVar1 = 4; intVar2 = 5; //3. Declare four more integer variables. exp1, exp2,exp3, and exp4. int exp1, exp2,exp3, exp4; //4. Declare a character variable charVar. char charVar; //5. Assign the value of each expression below to variables exp1and exp2 respectively: exp1 = intVar1 + ((5 * intVar2) / (3 * intVar1)); exp2 = intVar1 + (5 * (intVar2 / 3)) * intVar1; //6. Using the fprintf()function, print to standard output the values of the variables (your output should look like the following): //intVar1= 4 and intVar2 = 5 //Expression values are: exp1 = 6 exp2 = 24 fprintf(stdout, "intVar1 = %d and intVar2 = %d ", intVar1, intVar2); fprintf(stdout, "exp1 = %d exp2 = %d ", exp1, exp2); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote