. #include <math.h>. double. .
sin(x) | x | 2p 2p |
cos(x) | x | |
tan(x) | x | |
asin(x) | x | 1 1 |
acos(x) | x | |
atan(x) | x | |
sqrt(x) | x | |
exp(x) | e x | |
log(x) | x | |
log10(x) | x | |
ceil(x) | ||
floor(x) | , | |
pow(x, y) | x y | |
fmod(x, y) | x y |
if - switch.
if:
if(< >) <1>
[else <2>]
switch:
switch(<>)
{
case<1>: <1>
[break;]
case<2>: <2>
[break;]
........................................................
default: <>
}
#include <stdio.h>
#include <math.h>
void main(void)
{ int war;
float x,y,z;
printf("\npp :"
"\n1. z=3.55-(sin(x)+4.5)*y "
"\n2. z=(3.4*ln(x)+8.6)/2.3*y ( y ) ");
printf("\n \n");
ab: scanf("%d",&war);
switch(war)
{ case 1: printf("\n p y\n");
scanf("%g,%g",&x,&y);
z=3.55-(sin(x)+4.5)*y;
printf("\nz=%f",z);
break;
case 2: printf("\n p y\n");
scanf("%g,%g",&x,&y);
if(y>0)
{
z=(3.4*log(x)+8.6)/2.3*y;
printf("\nz=%f",z);
}
else
printf("\nHp o p z!!!");
\n );
break;
default: printf("\nHp !!!"
"\n ");
goto ab;
}
}
, . .
|
|
7
. , , , . , , , . : for, while do-while.
for
for :
For (; ; ) ,
;
, , ;
.
, . , for .
while
while
While () ,
, . , , . , . , . while , . .
do-while
do-while . do-while :
Do {