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

Please explain in DETAIL, I\'m having trouble understanding it. Thank you Type c

ID: 3637084 • Letter: P

Question

Please explain in DETAIL, I'm having trouble understanding it. Thank you

Type conversion: (When will you need them?)

Part 1: Accept 2 input values . Store them in int variables. Before dividing the first variable by the second variable, type cast to double and store the result into the 3rd variable. Check what the value of the 3rd variable is.

Part 2: Accept two integer values from user (say x and y.) Print the remainder when y is divided x. Which operator do you use.

Explanation / Answer

Please Rate: Thanks Programming code in c++ Part 1: #include           // This is a headder file used to activate cin and cout functions void main( )                         //main function starts the program here and void means return nothing to main function { int a,b;                                //declare 2 variables a and b as integers double c;                            // declare variable c as double couta>>b;                                          //read a and b values from user c=(double)a/(double)b;      //Type conversion used here convert the a and b as double then divide and store result in c couty;                                          //read a and b values from user z=x%y;      //THe % operator is used to find reminder and stores the result in z cout