You are on page 1of 13

:

C
. . ,
,
. & ,
T.E.I
Email: savvas@teilar.gr

: .

: / ,
, .
, ...,
MSc: Computer Science, University of Dundee,
Scotland,
PhD: Computer Science, UCD, Ireland, (Scheduling
and Assignment of CPU-Intensive Tasks on Large
Heterogeneous Distributed Systems),
C


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

C,
/ ,
,
C,
- Conditional Statements,
- Repetition Statements,
( ),
,
,
,
.
C

/ C

#1:


,
C?,
C,
,
(compile) (execute - run) .
C

1958: FORTRAN (FOrmula TRANslation)


,
:
1959: COBOL (COmmon Business Oriented
Language) , :
,
1964: BASIC ,
1967: SIMULA - ,
C

BCPL + B C

Procedural language,
Compilers &
(Operating Systems),
SW (1972 DEC PDP-11, Bell Laboratories)

Pascal , C ,
/

Modula, ADA, C++, Java, Lisp, Prolog, Scheme,


ML, Python, Ruby, ....
C

C?

C:

UNIX operating systems (Linux, Solaris)


C,
,
(
- reserved words),
,
,
,

C?

Linux ? ... gcc compiler


!
Windows ?

(Download and install)


CYGWIN: Cygwin Linux-like
Windows. http://www.cygwin.com/
gcc for windows, http://gcc.gnu.org/
C WEB, ..
http://www.softintegration.com/
C

. Kernigham, D. Ritchie, C Programming


Language ,
H. M. Deitel, P. J. Deitel, C: How To Program,
Prentice-Hall, Inc., New Jersey, USA, 1998,
A. Kelley, and I. Pohl, C by Dissection, Addison
Wesley Longman, 2001,
H. Schildt, C: The Complete Reference, Fourth
Edition, McGraw Hill, 2000,
World Wide Web

...

#include <stdio.h>
int main()
{
printf(\n ..);
printf(\n C!\n);
return 0;
}

10

??? ?
???



C
( Source)
!!

: ,
C

11

...
(Niklaus Wirth: = + )

,
, (

al-Khwrizm

)


,
C

12



.
,
()

/ ,
.
C

13

a, b
a>b


Flow Diagram

__

14

(?)

()?


,
.

:
C

15

/ .
(central
processing unit CPU)
.

, .
.
C

16

( ?) ...
:
,
,
:

:
CPU,
(RAM),
:

,
,
(),

- Hard
disks,
CDs, DVDs,
...

17

... ( ?)

:
:

, , ...

:
:

,
,



(

, , ...).

, ,...

:
,
,

Control units

(

(software)).
18

,
/ ,

,

, ,

.

19

" ,

CPU
,

,
/ (input-output circuits
- I/O)
()
.
C

20

(): 3

Edit:
(editor) /
,
Compile:
(
),
: ()
.
C

21

...
#include <stdio.h>
int main()
{
printf(\n ..);
printf(\n C!\n);
return 0;
=
}
( ),
= C.
:
C
(semicolon) <;>!!!
C

22


...

#include
Header Files stdio.h, math.h
main
!!! ( )
(braces): { }
return ?

return 0; 0
<main> !
C

23

...
...

#include <stdio.h>
int main()
{
printf(\n ..);
printf(\n C!\n);
return 0;
}

24

...

- Output:

pritnf() (print formatted)

, ...

C!


:
\n = , \t = tab,
C

25

...
...
#include <stdio.h>
int main()
{

printf(\n ..);
printf(\n C!\n);

return 0;
}

26

..
printf(\n ..);
printf(\n C!\n);

printf(\n .. \n C!\n);

27

?
#include <stdio.h>
int main()
{
printf(\n ..);
printf(\n C!\n);
return 0;
}

28

- Compile:

gcc test.c -o test.out (Linux)


gcc test.c -o test.exe (Windows)


(
- )
:

test.out (Linux)
test.exe (Windows)
C

29


#include <stdio.h>
int main()
{
printf(\n\t C\n\n );
printf(\n .\n);
printf(\n C :);
printf(\n\tC++, \n\tJava, \n\tC# \n\tD);
printf(\n\t \n\n);
return 0;
}

30

10


C

.
C :
C++,
Java,
C#
D

C

31

...


,
:
**********
**********
**********
**********

32

: :

#include <stdio.h>
int main()
{
int a=3, b=7, sum;
sum = a+b;

#include <stdio.h>
int main()
{
printf(\n 3+7=%d\n,3+7);

printf(\n =%d\n,sum);
return 0;
return 0;
}

}
C

33

11

da, b, sum, sum1, velocity,


vat, force, b12, a1b
1a, 2@, s&
Case sensitive aA

- Integers (int,
short, long),
- Real numbers
(float, double)

34

5+4, a+b, 4+b,

5-4, a-b, 4-b,

5*4, a*b, 4*b,

5/4, a/b, 4/b,

5%4 (=1), a%b, 4%b,

35

:
:

#include <stdio.h>
int main()
{
int a=3, b=7, sum;
sum = a+b;

#include <stdio.h>
int main()
{
printf(\n 3+7=%d\n,3+7);

printf(\n =%d\n,sum);
return 0;
}

return 0;
}

36

12

#1

???

email
: savvas@teilar.gr

37

13

You might also like