Exercise 3 #4

Merged
SinusFox merged 2 commits from exercise-3 into main 2023-05-10 08:17:11 +00:00
Showing only changes of commit ea2aef7ed1 - Show all commits
+3 -3
View File
@@ -20,10 +20,10 @@ int main() {
multiplication = first * second; multiplication = first * second;
if (second != 0) { if (second != 0) {
division = first / second; division = first / second;
} else {
printf("\n\nError: Dividing by 0 is not allowed. Output will be 0.\n\n");
}
modulo = first % second; modulo = first % second;
} else {
printf("\nError: Dividing by 0 is not allowed. Output will be 0 for devision and modulo.\n\n");
}
// output of calculation // output of calculation
printf("The results are:\n+ = %i\n- = %i\n* = %i\n/ = %f\nmod = %i", addition, subtraction, multiplication, division, modulo); printf("The results are:\n+ = %i\n- = %i\n* = %i\n/ = %f\nmod = %i", addition, subtraction, multiplication, division, modulo);