Home > Back-end >  Programming problem
Programming problem

Time:10-09

Who will be the programming problem ah help can you tell me the how to weave thanks

CodePudding user response:

Sofa sofa

(1) true & amp; & False 0

(2) really short circuit (behind) 1

(3) false (hereafter short circuit) 0, 0

CodePudding user response:

Bench bench

 # include 
# define PI 3.14
Int main ()
{
Float c, s, v;
Float r, h;
The scanf (" % f % f ", & amp; R, & amp; H);
C=2 * PI * r;
S=PI * r * r;
V=s * h;
Printf (" perimeter % 2 f \ n area % 2 f \ n % volume. 2 f \ n ", c, s, v);
return 0;
}

CodePudding user response:

The
reference 2 floor? Victor.?? Response:
bench bench

 # include 
# define PI 3.14
Int main ()
{
Float c, s, v;
Float r, h;
The scanf (" % f % f ", & amp; R, & amp; H);
C=2 * PI * r;
S=PI * r * r;
V=s * h;
Printf (" perimeter % 2 f \ n area % 2 f \ n % volume. 2 f \ n ", c, s, v);
return 0;
}

Where is to assign r and h

CodePudding user response:

Topic is not to say that the

The scanf enter

CodePudding user response:

Should do her these two problems, this is can improve the ability of logical operations,
Otherwise later check logic errors, more veiled,

& & Because of the logical operator priority is lower than the relational operators,
So first a + b> The value of the c and b==c
Because the mathematical operators and is greater than the relational operators at the same time, so to calculate a + b and c,

At the same time, because & amp; & And | | operation characteristic, c in order to improve the efficiency, so has the short circuit logic mentioned sofa type evaluation methods,
  • Related