Home > Back-end >  New people for help
New people for help

Time:03-09

Code: calculation of two and difference product remainder although there is no mistake but run out operation result
#include
Int main ()
{
//input
Printf (" please input the number in turn: ");
int a,b;
//the output
Long int x, y, z, n.
Double m;
The scanf (" % d % d ", a, b);
X=a + b;
Y=a - b;
Z=a * b;
M=a/b;
N=a % b;
Printf (" x=% d \ ny=% d \ lf nz=% d \ nm=% \ nn=% d \ n ", x, y, z, m, n);
return 0;
}
Error report:
| |===Build: Debug in 2 (Compiler: the GNU GCC Compiler)===|
Xiao \ Desktop \ codeblock \ \ the main 2 c | | In the function 'main' : |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 153 | warning: format '% d' expects the type int *, but argument has 2 type 'int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 153 | warning: format '% d' expects the type int *, but 3 from the argument type 'int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 159 | warning: format '% d' expects type 'int', but 2 from the argument type 'long int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 159 | warning: format '% d' expects type 'int', but 3 from the argument type 'long int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 159 | warning: format '% d' expects type 'int', but 4 from the argument type 'long int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 159 | warning: format '% d' expects type 'int', but 6 from the argument type 'long int' |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 153 | warning: 'a' is informs the uninitialized in this function |
Xiao \ Desktop \ codeblock \ \ the main 2 c | 153 | warning: 'b' is informs the uninitialized in this function |
| |===build finished: 0 error (s), 8 warning (s) (0, 1 second)===|

New post for the first time where do wrong, please point out to thank you

CodePudding user response:

Reference:
 # include & lt; stdio.h> 
Int main ()
{

//input
Printf (" please input the number in turn: ");
int a,b;
//the output
Long int x, y, z, n.
Double m;
The scanf (" % d % d ", & amp; A, & amp; b);//the scanf (" % d % d ", a, b);
X=a + b;
Y=a - b;
Z=a * b;
M=1.0 * a/b;//m=a/b;
N=a % b;
Printf (" x=% d \ ny=% d \ lf nz=% d \ nm=% \ nn=% d \ n ", x, y, z, m, n);

return 0;
}

CodePudding user response:

C language function are the value, that is, copy and paste, so if you want to modify the function of the parameters, the need to address
  • Related