#include <stdio.h>
int main( ) {
int num1, num2, num3;
int sum, difference, product, remainder;
float average;
// Prompt the user to input three integers
printf ( "Enter the first integer: " ) ;
printf ( "Enter the second integer: " ) ;
printf ( "Enter the third integer: " ) ;
// Perform calculations
sum = num1 + num2 + num3;
average = sum / 3.0 ; // Use 3.0 for float division
difference = num1 - num3;
product = num1 * num2 * num3;
remainder = num1 % num2;
// Display results
printf ( "Average: %.2f\n " , average
) ; printf ( "Difference (first - last): %d\n " , difference
) ; printf ( "Product: %d\n " , product
) ; printf ( "Remainder (first %% second): %d\n " , remainder
) ;
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKCkgewogICAgaW50IG51bTEsIG51bTIsIG51bTM7CiAgICBpbnQgc3VtLCBkaWZmZXJlbmNlLCBwcm9kdWN0LCByZW1haW5kZXI7CiAgICBmbG9hdCBhdmVyYWdlOwoKICAgIC8vIFByb21wdCB0aGUgdXNlciB0byBpbnB1dCB0aHJlZSBpbnRlZ2VycwogICAgcHJpbnRmKCJFbnRlciB0aGUgZmlyc3QgaW50ZWdlcjogIik7CiAgICBzY2FuZigiJWQiLCAmbnVtMSk7CgogICAgcHJpbnRmKCJFbnRlciB0aGUgc2Vjb25kIGludGVnZXI6ICIpOwogICAgc2NhbmYoIiVkIiwgJm51bTIpOwoKICAgIHByaW50ZigiRW50ZXIgdGhlIHRoaXJkIGludGVnZXI6ICIpOwogICAgc2NhbmYoIiVkIiwgJm51bTMpOwoKICAgIC8vIFBlcmZvcm0gY2FsY3VsYXRpb25zCiAgICBzdW0gPSBudW0xICsgbnVtMiArIG51bTM7CiAgICBhdmVyYWdlID0gc3VtIC8gMy4wOyAgLy8gVXNlIDMuMCBmb3IgZmxvYXQgZGl2aXNpb24KICAgIGRpZmZlcmVuY2UgPSBudW0xIC0gbnVtMzsKICAgIHByb2R1Y3QgPSBudW0xICogbnVtMiAqIG51bTM7CiAgICByZW1haW5kZXIgPSBudW0xICUgbnVtMjsKCiAgICAvLyBE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