國立暨南國際大學 101 學年度第一學期小考試卷

科目名稱:計算機概論 開課系所:資訊工程 學系 考試日期 2012.10.5
系所別:
年級:
學號:
姓名:
考試時間 10:30-11:00
  1. (10%) Represent 3.140625 in IEEE single-precision floating-point format.




  2. 請問凌網電子書(HyRead)提供線上閱讀的書籍格式為
    1. HTML (Hyper-Text Markup Language)
    2. MS-Word (Microsoft Word)
    3. PDF (Portable Document Format)
    4. Flash (Adobe Rich Internet Applications)

  3. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    // Operator precedence
    #include <iostream>

    using std::cout;
    using std::endl;

    int main()
    {
        int i = 10;
        int j = 5;
        cout << --i * j++ << endl;
        cout << i << j << endl;
        return 0;
    }

  4. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    #include <iostream>
    using std::cout;

    int main()
    {
        int i = 105;
        if (i % 2)
            if (i < 100) cout << "Smaller than 100.\n";
            else cout << "Greater than or equal to 100.\n";
        else
            cout << "It is an even number.\n";
        return 0;
    }