Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The correct problem in changing C language is to input two integers num 1 and num2, and calculate and output their sum, difference, product, quotient and remainder.
The correct problem in changing C language is to input two integers num 1 and num2, and calculate and output their sum, difference, product, quotient and remainder.
# include & ltstdio.h & gt

int main(void)

{ int num 1,num2

int x,y,z,j;

Floating k; /* * K must be defined as real number type, that is, float or double type, because the result of division may be decimal, otherwise it will lead to error */

printf(" Enter num 1 = "); /* * This line reminds you to enter the number num 1 and the contents in quotation marks */

scanf("%d ",& ampnum 1);

printf(" Enter num 2 = "); /* * This line reminds you to enter the number num2, and you only need the contents in quotation marks */

scanf("%d ",& ampnum 2);

x = num 1+num 2;

y = num 1-num 2;

z = num 1 * num 2;

k = num 1/num 2;

j = num 1% num 2;

printf("num 1+num2=%d\n ",x); The/* * equal sign should be followed by% d, and% d means that the output is plastic data, that is, int type */

printf("num 1-num2=%d\n ",y); /* * The output should be printf instead of print, and it is better to add \n line break */

printf("num 1*num2=%d\n ",z);

printf("num 1/num2=%f\n ",k); /**k defines a floating-point type, so it should be %f instead of %d*/

printf("num 1%num2=%d\n ",j);

Returns 0;

}

}

/* * You can run what I changed for you. I suggest you learn to indent when programming in the future to make the program structure clear. If you have any questions about learning C language, please feel free to communicate with me */