Lecture Notes

# Lecture Notes - Modularity Classes/structures Functions...

This preview shows pages 1–4. Sign up to view the full content.

January 25, 2010 Modularity Classes/structures Functions - 5 [square()] 25 Identifiers example: Int main() { Int a; A = 5; B = square(a); Cout<<:The square of”<<a<<”is”<<b<<endl; Return 0; } Identifiers A, b ,number, square, xqf3221 Keywords (about 50 listed in the book) Int, if, return The main() Function Where the program starts executing Example

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Int main() Int num Insigned int u = 50; Char c; Num = 100; C = ‘x’; Cout<< “the character is”<<t<<endl; Cout<<”the number is”<<num<<endl; Num = num + c Cout<<”the character is now”<<c<<endl; Cout<<”the number is now”<<num<<endl; Cout<<”the character and number respectively”<<”occupy”<< January 27, 2010 Arithmetic operators 14/3 = = 4 (quotient without the remainder) 14%3 == 2 (remainder without the quotient) 61+14/3 == 65 (61+14)/3==25 Precedence * / % higher + - lower Char(61+14/3)==’A’ February 1, 2010 double
11 bits (exponents) | 52 bits (mantissa) <______________64 bits____________________> Char – 8 bits Int - 32 bits -128 thru +127 Discuss Int sum = 25; Sum = sum + 10; Cout << sum << endl; (sum = 35)) Or Int sum = 25; Sum += 10; Cout << sum << endl;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/15/2011 for the course ECE 1574 taught by Professor Rpbroadwater during the Spring '08 term at Virginia Tech.

### Page1 / 9

Lecture Notes - Modularity Classes/structures Functions...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online