.


:




:

































 

 

 

 


( )




x = 5 / 3 ( 1)

4) % - (3) ( )

= 5%3 ( 2)

5) + sum = 20+10; sum = 20 + x; sum = hou + sec; (4)

6) (4)

7) -- ++ 1 (2)

2 ++i - ( i ) i++ - ()

++size < 18,5 , 18,5

size++ <18,5 , 1.

: y=2; n=3;

y=n++ y n, n 1. y 3, n - 4

next=(y+n++)*6; , n 1 ( ) (2+3)*6=30; n=4;

next=(y+(++n))*6; n 1. (2+4)*6=36; n=4;

8) sizeof (2)

( ) sizeof (int); sizeof x;

9) = (15)

= . .

val = 3,75; PI = 3,14;

i = i+1; , = , . i 1 i.

( )

y = x = z = 1;

. = :

3,75 = val

10) , ()

=5, =24; (16)

, , . ( ).

 

 

<, (7) > =, (7)

<=, (7) != (8)

> (7) = =. (8)

. .

= = =. (=) . (= =) , .

(0 1). .

float < >, .. , , . ( 3*1/3 1,0, 1/3 0,999999, 1)

, +, -.

y > x+2; - , .

 

 

, .

1) && "" ( .)

, , &&. , . (12)

2) || "" ( .)

, . , (13)

3)! "" () (2)

 

:

x y && || !
        0 11
       
         
       

 

:

if(x>0 && x<10)

5>2 && 4>7 -

5>2 || 4>7 -

!(4>7)

 

! () ( ). && || , .

a>b && b>c || b>d

((a>b) && (b>c) || (b>d))

 

 

. . char. , , .

1) ~ 1 . 1 0, 0 1.

~(11010) (00101)

2) & . . 1, 1

(10010011) & (00111101) => (00010001)

3) | . . 1, ( ) 1.

(10010011) | (00111101) => (10111111)

4) ^ . 1, 1 ( )

(10010011) ^ (00111101) => (10101110)

 

 

. . . .

1) << , . , , , .

(10001010)<<2 = = 00101000

2) >> , . , , . . .

(10001010)>>2 = = 00100010

2:

number<<n number 2 n-

number>>n number 2 n-

 

6.6. ?:

 

(? :) (1? 2: 3). if else .

: x = (y<0)? y: y; , 0, = -, = . if else :

if(y<0)

x = -y;

else

x = y;

.

.. 1 , 2, 1 2.

, , .

max = (>b)? a: b;

 

 

. ( ). , :

1. 2- , ( "" ).

2. : double, float, long, int, short, char. unsigned .

3. , ( ). "" .

4. float double ( , ). float, .

 

 

, . .

int num;

num = 1,6+1,7; 3,3 => 3. , .

num = (int)1,6+(int)1,7; 1+1 = 2. , , .

 





:


: 2016-11-23; !; : 410 |


:

:

,
==> ...

1330 - | 1299 -


© 2015-2024 lektsii.org - -

: 0.021 .