.


:




:

































 

 

 

 


2. .




/*luxury2.c*/main() { float cost, tax, luxury, total; luxury = 0.0; printf(" : "); scanf("%f", &cost); tax = cost * 0.06; if (cost > 40000.00) { luxury=cost*0.005; printf(" %.2f\n", luxury); } total = cost + tax + luxury; printf(" %.2f", total); }

if...else

if , . , , . , , , - , , : . if:

if (cost> 40000.00) { luxury = cost * 0.005; printf(" \ %.2f", luxury); }if (cost< 40000.00) puts(" \ ");

. , , : 40 , . , , ,


. 2. , else

 

 

, else ( ):

if (condition) instruction;else instruction;

: , , if, , else. , else, , . , , , if. else.

, , .2. , luxury , if .

3 , . c if, . , 3, , , , , , .

, , , . , , . , , ask():

ask("9+5= ", 14);




:


: 2017-03-12; !; : 254 |


:

:

,
==> ...

1711 - | 1647 -


© 2015-2024 lektsii.org - -

: 0.01 .