Docstoc

homework 1

Document Sample
homework 1 Powered By Docstoc
					Thomas Do

COSC 1436

Num   Code                                     Output
      cout << "Hello";
1.                                              HelloGoodbye
      cout << "Goodbye";
      cout << "apple";
2.    cout << "endl";                           Appleendlpear
      cout << "pear";
      cout << "a\nb\nc";                        a
3.                                              b
                                                c
4.    cout << 1 + 2 * 3;                        7
5.    cout << 5 % 2;                            1
6.    cout << (3 + 4) * (8 % 5);                21
      cout << "mustard/npickles";
7.                                              mustard/npickles

      cout << "I love computers" endl;
8.                                              Error

9.    cout << "5 * 2 + 6 * 3";                  5 * 2 + 6 * 3
      cout << "a" << endl << "z";               a
10.
                                                z
      int A;
      A = 15;
11.                                             45
      A = A * 3;
      cout << A;
      int A = -4;
12.   A = A + 4;                                A
      cout << "A";
      int X = (5 % 2) + (15 / 3);
13.                                             12
      cout << X * 2;
      int Orange;
14.   Orange = 5 + 7 * 2 - 3                    Error
      cout << Orange;
      cout << "Mustang is ";
      int Year = 2003;
15.                                             Mustang is 38 years old
      int Car = 1965;
      cout << Year - Car << " years old";
      int T1 = 70;
16.   int T2 = 75;                              40 degrees
      cout << T2 - T1 * 0.5 << " degrees";
17.   cout << 1 << "2" << 3 << "4" << 5;        12345
      int A = -8;
18.   A = A * -0.25;                            2
      cout << A;
      int B = 4;
19.                                             25
      cout << B + (B + B) * 3 - B + (B % 3);
20.   cout << "Grand Canyon"\n;                 error

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:4
posted:2/15/2012
language:
pages:1