{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture Notes 1.25 - Num = num c Cout<<”the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full Document Right Arrow Icon
Int main() Int num Insigned int u = 50; Char c; Num = 100; C = ‘x’; Cout<< “the character is”<<t<<endl;
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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’...
View Full Document

{[ snackBarMessage ]}