<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            C語言開發工程師選擇題

            時間:2020-11-23 10:00:11 筆試題目 我要投稿

            C語言開發工程師選擇題

              1.分析如下所示C#代碼,編譯運行后的輸出結果是( )。(選擇一項)

              public static void Main(string[] args)

              {

              int param = 2;

              string position = “”;

              switch (param)

              {

              case 1:

              position = “兄長”;

              break;

              case 2:

              position = “兄弟”;

              break;

              }

              Console.WriteLine(position);

              }

              a) 兄長

              b) 兄弟

              c) 小妹

              d) 兄長兄弟

              2.現有如下一段C#代碼,該代碼的運行結果是( )。(選擇一項)

              public static void Main(){

              for (int i=1;i<=3;i++){

              switch(i){

              case 1:

              Console.Write(i.ToString());

              break;

              default:

              Console.Write((i*3).ToString());

              }

              }

              }

              a) 169

              b) 有編譯錯誤 沒有break!!!

              c) 369

              d) 123

              3.看以下一段程序:

              Console.Write("hello world !");

              Console.WriteLine("friend.");

              int i=0;

              do

              {

              Console.Write("thank you !");

              i++;

              }while(i<2);

              程序的輸出結果是( )(選擇一項)

              a) hello world ! friend thank you !thank you !

              b) hello world ! friend

              thank you !thank you! Writeline 代表能換行

              c) hello world ! friend. thank you ! thank you !

              d) hello world !

              friend. thank you !

              4. using System;

              class Test{

              static void Main(String [] args){

              int a=10,b=20,c=30;

              if(a>b||b>c)

              Console.WriteLine(a);

              else if(a

              Console.WriteLine(b+c);

              else

              Console.WriteLine(c);

              }

              }

              a) 10

              b) 20

              c) 50

              d) 60

              5. 以下C#程序:

              static void Main(string[] args)

              {

              int val = 1;

              for (int i=3;i<10;i+=2)

              {

              Console.WriteLine(i);

              }

              }

              運行時將輸出( )。(選擇一項)

              a) 3

              5

              7

              9

              b) 5

              7

              9

              c) 5

              7

              9

              11

              d) 9

              6. 分析下面的代碼片段,正確的輸出結果是( )。(選擇一項)

              int i=0;

              for(;i<4;i+=2){

              Console.Write(i+”,”);

              }

              Console.Write (i);

              a) 0,2

              b) 0,2,4

              c) 0,2,4,6

              d) 0,1,2,3

              7. 給定如下C#代碼片段,編譯運行結果是( )。(選擇一項)

              int i = 0, j = -1;

              switch (i){

              case 0,1: j=1;

              case 2: j=2;

              }

              Console.Write (“j=”+j);

              a) 程序編譯出錯

              b) 輸出:j=1

              c) 輸出:j=2

              d) 輸出:j=0

              8. 在C#中,下列代碼的.運行結果是( )。(選擇一項)

              using System;

              class Test{

              static void Main(string[] args){

              int a=21,b=22,c=23;

              if (a>b‖b>c)

              Console.WriteLine(++b);

              else

              Console.WriteLine(a+b+c);

              }

              }

              a) 22

              b) 23

              c) 66

              d) 編譯出錯

              9. 以下關于C#代碼的說法正確的是( )。(選擇一項)

              for(int i=1;i<=3;i++)

              {

              switch(i)

              {

              case 1:

              Console.Write(i.ToString();

              case 2:

              Console.Write((i*2).ToString();

              case 3:

              Console.Write((i*3).ToString()

              }

              }

              a) 有編譯錯誤,提示case標簽不能貫穿到另一個標簽,不能運行 沒有寫Break!!!!

              b) 輸出149

              c) 輸出123246369

              d) 正確運行,但沒有輸出

              10. 針對以下的C#代碼:

              using System;

              class A

              {

              static void Main()

              {

              int[] B = new int[10];

              for(int I=1;I<=10;I++)

              {

              //空白處

              }

              foreach (int C in B)

              {

              Console.WriteLine (C);

              }

              }

              }

              要在控制臺輸出1到10的數字,空白處應填寫的正確的代碼為( )。(選擇一項)

              a) B[I]=I+1;

              b) B[I]=I;

              c) B[I-1]=I;

              d) B[I+1]=I;

              11.在C#中,下列代碼的運行結果是( )(選擇一項)

              int a=30,b=20;

              b=a;

              a=10;

              Conlose.WriteLine(a);

              Conlose.WriteLine(b);

              a) 10

              10

              b) 10

              30

              c) 30

              20

              d) 10

              20

              12.下列語句執行后,變量i的值為多少?( )(選擇一項)

              string str = @”"”Ahoy”",cried the caption. “;

              string str2 = “\”Ahoy\”,cried the caption. “;

              int I = string.Compare(str,str2);

              a) false

              b) -1

              c) 1

              d) 0

              13.在VS.Net開發環境中,為程序代碼增加斷點,快捷鍵為( )。(選擇一項)

              a) F2

              b) F5

              c) F8

              d) F9

              14.在ADO.NET中,( )對象的結構類似于關系數據庫的結構,并在與數據庫斷開的情況下,在緩存中存儲數據。(選擇一項)

              a) DataAdapter 加載數據源

              b) DataSet 重載

              c) DataTable

              d) DataReader 讀取機制

              15. 下面關于數據庫操作的代碼,錯誤的是( )(選擇兩項)

              a) SqlConnection conn = new SqlConnection();

              SqlCommand comm = new SqlCommand();

              comm.ExecuteNonQuery();

              b) SqlConnection conn = new SqlConnection(“server=.;uid=sa;pwd=sa;database=db1”);

              conn.Open();

              SqlCommand comm = new SqlCommand(“delete * from table1”, conn);

              comm.ExecuteNonQuery();

              conn.Close()

              c) SqlConnection conn = new SqlConnection(“server=.,uid=sa,pwd=sa,database=db1”);

              conn.Open();

              SqlCommand comm = new SqlCommand(“delete * from table1”);

              comm.ExecuteNonQuery();

              conn.Close();

              d) SqlConnection conn = new SqlConnection(“server=.;uid=sa;pwd=sa;database=db1”);

              conn.Open();

              SqlCommand comm = new SqlCommand(“delete * from table1”, conn);

              comm.ExecuteNonQuery();

              16.運行下面一段代碼:

              class Class1

              {

              public static int count = 0;

              static Class1()

              {

              count++;

              }

              public Class1()

              {

              count++;

              }

              }

              Class1 o1 = new Class1();

              Class1 o2 = new Class1();

              請問,o1.count的值是多少?( )(選擇一項)

              a) 1

              b) 2

              c) 3

              d) 4

              17.在C#中,下列代碼的運行結果是( )。(選擇一項)

              class A{

              public void printStr(string str){

              Console.WriteLine(str);

              }

              }

              class B:A{

              new public void printStr(string str){

              str=str+”(override)”;

              Console.WriteLine(str);

              }

              public static void Mail(string[] args){

              A a=new A();

              B b=new B();

              a.printStr(“test”);

              b.printStr(“test”);

              }

              }

              a) test

              test(override)

              b) test(override)

              c) test

              d) test(override)

              test(override)

              18.分析以下C#代碼,根據面向對象的多態性,代碼的運行結果是( )。(選擇一項)

              class A{

              public void F(){

              Console.Write(“A”);

              }

              方法重載

              public void F(string chr){

              Console.Write(chr);

              }

              }

              class B:A{

              public void F(){

              Console.Write(“B”);

              }

              }

              public class Test{

              public static void Main(string[] args){

              A a = new B();

              a.F();

              }

              }

              a) B

              b) A

              c) AB

              d) BA

            【C語言開發工程師選擇題】相關文章:

            C語言開發工程師選擇試題12-25

            C語言游戲開發筆試題06-15

            嵌入式開發—C語言面試題08-17

            2016年嵌入式開發C語言問題詳解11-02

            Jr.C++/C#開發工程師面試筆試題目11-14

            嵌入式開發中C語言中結構體解讀201611-02

            C語言編程練習12-25

            C語言編程題12-24

            C語言符號積累08-20

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看