Question: for my C++ lab i need to make a code that will take a user inputed number, and square it. then take the same user

for my C++ lab i need to make a code that will take a user inputed number, and square it. then take the same user inputed number (not the squared one) and divide it by three as well as show the remainder. this is the code right now which is diving the squared the number which i dont want. how could this be fixed? its working perfectly i just it to divide the user inputed number instead if the squared one as well as show the remainder. thanks
for my C++ lab i need to make a code that will
take a user inputed number, and square it. then take the same

. X Microsoft.cpphudargas 2 usz Beinclude Ginclude Global Scopel edefine _CRT_SECURE_NO_JURNINGS LAB 2: Using Functions Developed by: Taitun Laroque Date: Jan 14, 2020 Description: //Function Prototypes void purpose(); int Getumber(); int square(int num): float DivideByThree(int), int RemaindertyThree(float); vold Display(int & Int se, float b, Intres); alat main() { INariable Declarations/user Inputs purpose(); int um. Getumber(); int e re( ); float res - DividelyThree(a) Int re RemindertyThree(s): Displayim, sa res, rem); while (U_ht(): I/keeps window open until keybored is pressed Purpose. This function prints the purpose of the program to the console. Eveld purpose(void) printf( this progres will take a user input and square it, divide by 9) printf(" and display the remainder) cer . This function rests the interme it to the calling function. Returned The Integer given from user ( int Gethumber() . X Global Scope of Copbuild targets LAB 2 64 Bint Get Number() int number: printf(" Please insert Integer value here :"); scanf("%d", &number); return number; Square - calculates the square of the integer and returns the result. Input: The number from the calling function (int) Returned: returns the squared value (int) Teint square(int num) return num ; DivideByThree - Divides the integer by three and returns the result. Input: The number from the calling function (int) Returned: Returns the divided number (float) Tefloat DivideByThrea(int nun) return ((float)num) / 3; RemainderbyThree - Calculates the remainder of the interer entered divided by and returns the result. Input: The number from the calling function (float) Returned returns the remainder (int) 102 Teint RemaindertyThree(float num) return ((int)nue) X 3; 510 Display - This function displays the result to the console Inputs: Results from getumber (Int), Square (int), DavidelyThree (float). RemainderbyThree (int) T void Display(int , int 14. float b. Int ree) printf("Number M . a); printf("squared Nd ". ) printf("DividetyThree X.af ", b) printf("RemainderbyThree Min", rem); printf(" boodbye), ound N Oulu Show output from Delag

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!