02 int area (int a, int b) user defined function *//* 03 {int s;/* s for integer variables */4 s=a * b; The product of a and b/* o */
05 return s; Returns the value of s/* */
6}
07 void main ()/* */
main function08 {int x, y;/* definition of x, y as integer variables */09 the scanf (" % d % d ", & amp; X, & amp; Y);/* get x, y */10 printf (" \ nx=% d, % d "y, x, y); The value of the output/* x, y */11 int z;/* z for integer variables */12 z=area (x, y); Call functions/* */
13 printf (" \ nThe area of the rectangle is: % d ", z);/* the output value of z */
14}
CodePudding user response:
Also can not, the s=a * b; In the main function is the same,But for the modular, suggest use custom, this may be able to mention the readability of the code has
Suggest the building code before, the first produced, format and annotation is not the more the better, but the key areas to add annotations, more comments but its side effects, make the code at bloated ~