Read without ads and support Scribd by becoming a Scribd Premium Reader.
 
Oxford University Computing Services
Programming in C
Languagesl9.2/2
 
Typographical Conventions
Listed below are the typographical conventions used in this guide.Names of keys on the keyboard are enclosed in angle brackets; for example <Enter> represents theEnter (or Return) key.Two key names enclosed in angle brackets and separated by a slash (for example, <Ctrl/Z>) indicatethat the first key should be held down while the second is pressed; both keys can then be releasedtogether.Where two or more keys are each enclosed in separate angle brackets (for example,<Home><Home><Up arrow>) each key in the sequence should be pressed in turn.Characters typed in by the user are in lower-case non-bold characters in typewriter font.Other options and button names are shown in lower-case non-bold characters in typewriter font.Pull-down menu options are indicated by the name of the option enclosed in square brackets, forexample
[File/Print]
. To select the option
[Print]
from the
[File]
menu: click with the mousebutton on the
[File]
menu name; move the cursor to
[Print]
; when
[Print]
is highlighted, click the mouse button again.Where menu items or large sections of output are included, they are shown as they would be displayedon the screen.Sections marked with a ‡ are more advanced and can be omitted on a first reading.
 
October 1996OUCS
Programming in Cl9.2/2
Contents
1 Introduction1
1.1 About this Userguide11.2 Why use C?1
2 An Example C Program23 Variables and Expressions3
3.1 Variable Declaration33.2 Variable Types33.3 Variable Names43.4 Assignment53.5 Arithmetic Operators63.6 Increment and Decrement Operators73.7 Cast Operators73.8 Bitwise Operators 73.9 Promotions and Conversions 83.10 Parsing Rules 103.11 Symbolic Constants and The Preprocessor11
4 Input and Output11
4.1 Formatted Output —
 printf 
114.2 Conversion Specifiers124.3 Literal Constants134.4 Formatted Input —
scanf 
154.5 Character I/O —
getchar 
&
 putchar 
164.6 End-of-File17
5 Flow of Control17
5.1 Relational and Logical Operators175.2 Conditional Branching —
if 
185.3 Conditional Selection —
switch
195.4 Iteration —
while
,
 for 
205.5 Local Jumps —
goto
215.6 Short Circuit Behaviour 225.7 Problems225.8 Declaring Array Variables235.9 Initialising Array Variables24
6 Functions25
6.1 Building Blocks of Programs256.2 Return Value256.3 Function Parameters25
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • Notes
    Load more