Programming in C
20 Chapter 3 Compiling and Running Your First Program INT sum; /* COMPUTE RESULT sum = 25 + 37 - 19 /* DISPLAY RESULTS // printf ...
4 Va riables, Data Types, and Arithmetic Expressions IN THIS CHAPTER,YOULEARN MOREabout variable names and constants.You also ta ...
22 Chapter 4 Variables, Data Types, and Arithmetic Expressions The rules for forming variable names are quite simple:They must b ...
Understanding Data Types and Constants 23 Understanding Data Types and Constants You have already been exposed to the C basic da ...
24 Chapter 4 Variables, Data Types, and Arithmetic Expressions Immediately following the letter xare the digits of the hexadecim ...
Understanding Data Types and Constants 25 To display a value in scientific notation, the format characters %eshould be specified ...
26 Chapter 4 Variables, Data Types, and Arithmetic Expressions The format characters %ccan be used in a printfcall to display th ...
Understanding Data Types and Constants 27 doubleVar = 8.44e+11 charVar = W boolVar = 0; The first statement of Program 4.1 decla ...
28 Chapter 4 Variables, Data Types, and Arithmetic Expressions Type Specifiers:long,long long,short,unsigned, and signed If the ...
Understanding Data Types and Constants 29 On some machines, a short inttakes up half the amount of storage as a regular int vari ...
30 Chapter 4 Variables, Data Types, and Arithmetic Expressions Ta ble 4.1 Basic Data Types printf Type Constant Examples chars c ...
Working with Arithmetic Expressions 31 int a = 100; int b = 2; int c = 25; int d = 4; int result; result = a - b; // subtraction ...
32 Chapter 4 Variables, Data Types, and Arithmetic Expressions On some computer systems, attempting to divide a number by zero r ...
Working with Arithmetic Expressions 33 is evaluated according to the rules stated previously as (a b) + (c d) or (100 2) + (2 ...
34 Chapter 4 Variables, Data Types, and Arithmetic Expressions solely for aesthetic reasons. In general, you can add extra blank ...
Working with Arithmetic Expressions 35 results in the multiplication of –aby b. Once again, in Appendix A you will find a table ...
36 Chapter 4 Variables, Data Types, and Arithmetic Expressions The last line of output in Program 4.4 requires a bit of explanat ...
Working with Arithmetic Expressions 37 int i1, i2 = -150; char c = 'a'; i1 = f1; // floating to integer conversion printf ("%f a ...
38 Chapter 4 Variables, Data Types, and Arithmetic Expressions portion resulting from a division operation is discarded, even if ...
Types _Complexand _Imaginary 39 In this format,opis any of the arithmetic operators, including +,–,×,/,and %.In addition,opcan b ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf