st02-cpp_basics

st02-cpp_basics - CSC 1111 Introduction to Computing using...

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

View Full Document Right Arrow Icon
1 CSC 1111 Introduction to Computing using C++ Basics of C++ (Self-test questions)
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Output and String Constants Write a C++ statement to print the following text: The movie title is "Aliens". Write only a C++ statement to print the following text: \\ // ABCDEF
Background image of page 2
3 Identifiers What are the rules for naming identifiers? What's the difference between reserved words and predefined identifiers?
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Operators and Expressions Evaluate the following expressions 100 % 11 % 5 23 % 4 * 3 / 2 (10 + 5) * (6 + 3 * 2) * (7 - 8) 2.2 - 2 - 0.1 - 0.1
Background image of page 4
5 Expressions Express the following math expressions in C++ ( 29 [ ] { } a b a c d a a b a b a b a b a b a c b a a c a b + - + + - + - + + - - - . 5 . 4 . 3 1 10 . 2 4 . 1 2 2 3 3 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
++ and -- Operators int num1 = 1, num2 = 2, num3 = 4; num1 = ++num2; // num1 = ? , num2 = ? num1 = num3-- * 4; // num1 = ? , num3 = ? num1 = num2 = 2;
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 10

st02-cpp_basics - CSC 1111 Introduction to Computing using...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online