?C
C
C

CPU01
10000000
10010000 ADD A,B
.
I/O
CPU
>>
1.1 C
52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96
Ada
ALGOL60 ALGOL68
Pascal
Modula-2
CPLBCPL B C
C++
Java
LISP
PROLOG
COBOL
FORTRAN77FORTRAN
PL/1
Simula 67
Smalltalk 80
BASIC ANSI-BASIC QBASIC VB
FORTRAN90
< >
C?
C
–,1972~1973
–,
–,UNIX
–,Ken.ThompsonDennis.M.Ritchie
C
– C,K&RThe C Programming Language
– ANSI C,1983
– 87 ANSI C,1987
– 1990ANSI C
< >
C
C




< >
> > >
>>
>
1.2 C
C
()
auto break case char
const
continue default do double else
enum extern float for goto
if int long register
return
short signed sizeof static
struct
switch typedef unsigned union void
volatile while
<
32
C
if( )~else~
for( )~
while( )~
do~while( )
continue
break
switch
goto
return
<
C
<
C
void
typedef
char
enum
float
double
short
long
int
struct
union
<
C
/* example1.1 The first C Program*/
#include <stdio.h>
main()
{
printf(“Hello,World!”);
}
>
Hello,World!
1.3 C
C/* example1.1 calculate the sum of a and b*/
#include <stdio.h>
/* This is the main program */
main()
{ int a,b,sum;
a=10;
b=24;
sum=add(a,b);
printf(”sum= %d\n",sum);
}
/* This function calculates the sum of x and y */
int add(int x,int y)
{ int z;
z=x+y; return(z);
} sum=34>
C
< >
main( )
{ ……………….
………………
…………..
…………..
………
……….
……………
…………….
……………….
………………..
}
main( )
{
int i,j,sum;
sum=0;
for(i=1; i<10;i++)
{
for(j=1;j<10;j++)
{
sum+=i*j ;
}
}
printf(“%d\n”,sum);
}
:
TAB
{}
C

– main()
– mainmain
– C
– ;”
– /* */,

< >
/*This is the main /* of example1.1*/ */
C
< >
f i l e,c
f i l e,obj
file.exe
,
*.c
*.obj
,
*.exe
.c,o b j,e x e
1.4 C