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

科目名稱:計算機概論 開課系所:資訊工程 學系 任課教師
吳坤熹
系所別:
年級:
學號:
姓名:
考試日期
2012.9.25

(考試時間: 16:15-16:35)

  1. (10%) Convert the decimal number 67 to binary.




  2. (10%) Interpret 10111011 in decimal if the number was stored as a sign-and-magnitude integer.



  3. (10%) Determine whether the following code has syntax errors or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).

    // Scope of a variable
    #include <iostream>

    int main()
    {
        int value1 = 925;
        {
            int value2 = 3;
            std::cout << value1 << std::endl;
        }
        std::cout << value2 << std::endl;
        return 0;
    }