/*
This is the third lab of Lab EE107
The purpose of this lab is to illustrate the various use of these operators and understand the order of precedence
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Jan 30, 2024.
*/
#include <stdio.h>
int main(void) {
int numberA_EU = 5;
int numberB_EU = 4;
int numberC_EU = 3;
//Declare variables for storing output
int aTimesA, bTimesB, cTimesC, cTimesC_PlusbTimesB, aTimesA_MinusbTimesB, Result_of_Operation;
int VaTimesA_MinusVbTimesB, VcTimesC_MinusVbTimesB, VcTimesC_PlusVbTimesB, Result_of_Precedence;
aTimesA = numberA_EU * numberA_EU;//multiplication
printf("numberA_EU * numberA_EU = %i\n", aTimesA);
bTimesB = numberB_EU * numberB_EU;//multiplication
printf("numberB_EU * numberB_EU = %i\n", bTimesB);
cTimesC = numberC_EU * numberC_EU;//multiplication
printf("numberC_EU * numberC_EU = %i\n", cTimesC);
aTimesA_MinusbTimesB = aTimesA - bTimesB;//operations of the product of variables
printf("aTimesA - bTimesB = %i\n", aTimesA_MinusbTimesB);
//like mathematical operation, the multiplication and divison has high
//priority than addtion and subtraction
VaTimesA_MinusVbTimesB = numberA_EU * numberA_EU - numberB_EU * numberB_EU;//operations of the product of variables
printf("numberA_EU * numberA_EU - numberB_EU * numberB_EU = %i\n", VaTimesA_MinusVbTimesB);//precedence of multiplication
VcTimesC_PlusVbTimesB = numberC_EU * numberB_EU + numberB_EU * numberB_EU;//operations of the product of variables
printf("numberA_EU * numberA_EU - numberB_EU * numberB_EU = %i\n", VcTimesC_PlusVbTimesB );// precedence of multiplication
VcTimesC_PlusVbTimesB = (numberA_EU * numberA_EU - numberC_EU * numberC_EU)/numberB_EU;//operations of the product of variables
printf("(numberA_EU * numberA_EU - numberC_EU * numberC_EU)/numberB_EU = %i\n", Result_of_Precedence);// precedence of multiplication
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: