You are on page 1of 4

char 0 255.

char. ,
char response;
char intable, latan;
char isma = ' S ';

. , -
broiled = ' '; /* */,

broiled = ; /* */
, "", ,
,
ehar bovine;
bovine = ' ox '; /* */
ASCII, , ""
ASCII.
beep = ' \007 ';
, .
ASCII ,

. 3. 4.
""

\n
\t
\b
\r
\f
\\ (\)
\' (')
\" (")

nerf = ' \n ';
nerf;
,
, " \ ".
:
printf(" , \" \\ . \" \n");
. -,
1. , ,
2.

main( ) /* */
{
char ch;
printf(" , , .\n");
scanf(" %c", &ch); /* */
printf("Ko % %d.\n", ch, ch);
}
[] []

float
double

1
123000
=322.56
0.000056

000000000
1.0
1.23
3.2256
5.6
?
?10-5
109
?105102
==
1.0e9

=1.235
5.6-5
3.22562


,
32 - 8
double (

double l
. 3.5. .

,
float noah, jonah;
double trouble;
float planck = 6.63e- 34;

.
-1.56+12
2.87-3
+ . ,
3.14159
.2
416
.8-5
100.

1.56+ 12 -

some = 4.0*2.0;
4.0 2.0 double, . .



, float ?
:


: int,


.
int: , ;
long long int: , ,
short short int: short ,

, , , &, + . .
Char: , .
.
float: ;
double long float
:

1. .
2. .
3. :
- -;
- .
:
int erest;

unsigned short cash;


4. ,
char ch, unit, ans;
5. :
float mass = 6.0E24;

.
, .
. 3.6. .

.
3.1.

DEC
PDP-11

16
DEC
VAX

Interdata
32

8/3
32
IBM
PC
(Lattice C)
8
char
16
32
64
-307
76
38

short
long
float
double
int
? 308
(double)

? :
main( )
{
printf(" int %d . \n", sizeof (int));
printf(" char %d .\n", sizeof (char));
printf(" long %d .\n", sizeof (long));
printf(" double %d .\n", sizeof (double));
}
sizeof,
,



int apples = 3; /* */
int oranges = 3.0; /* */
"" , , , ,






. ,
: int, short, long, unsigned, char, float, double.
: int beancount, float root-beer; . .
int: 256, 023, OXF5 . .
char: 'r', 'U', '\007', '?' . .
float: 14,92, 1.67-27 . .
.
.

1.
.
.
.
.
2. ( )
. '\b'

.
.
.
.

1066
99 44
OXAA
2030

3. ()3)
#include < stdio h>
main
(
float g, h,
float tax, rate,
g = e21, tax = rate*g,
)

1.a.
.
.
.

int, short,
float, ,
char
int, unsigned

2.a.
.
.
.
.

char, " "


int, 4)
float,
int, 170
float,

3.

1:
2:
3:
4:
5:
6:
7:
8:
9:

main, . . main( )
{, (
g h ,

()
: , 121 1 021

}, )

:
- rate .
- h .
.

1) 1 - 454 , 1 31 -
2) - - .

3)
4) - .

You might also like