资源预览内容
第1页 / 共12页
第2页 / 共12页
第3页 / 共12页
第4页 / 共12页
第5页 / 共12页
第6页 / 共12页
第7页 / 共12页
第8页 / 共12页
第9页 / 共12页
第10页 / 共12页
亲,该文档总共12页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
c#winform笔试测试题 作者: 日期:12 个人收集整理,勿做商业用途 C#winform笔试测试题(100分)一选择题(2*30=60)1.以下的C#程序代码,程序运行时在控制台打印输出值为()。(选择一项)Int count=3;while(count1) Console.Write(-count);a) 32b) 321c) 21d) 22. 在C#中,下列代码的运行结果是()(选择一项)Using Sysatem;Class Test Static void main(string args) Stringstrings=“a”,”b”,”c”,; Foreach(string info in strings) Console.write(info);(a) abc(b) a(c) b(d) c3. 现有如下一段C#代码,该代码的运行结果是()。(选择一项) Public static void Main() For(int i=1; i18) Continue; Console.Write(i.ToString()+” ”);a) 16 18 20 14 22b) 16 18 14 22c) 16 18 14d) 16 185以下关于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)123b)146c)语法错误d)1234696. 运行以下C#代码,其输出结果是()。(选择一项)static void Main()string test=ABCD;foreach(char c in test)Console.Write(c);a)ABCDb)DCBAc)ABCDd)DCBA7. C#语言提供了四种不同的循环结构,其中(D )循环结构在Java语言JDK1.5(含)以前的版本中没有对应类似的循环结构。 (选择一项) a) while b) do while c) ford) foreach8. 在c#程序中,己知某一维数组名称为myArray,则该数组的长度为( )。(选择一项) a) myArray.Length b) myArray.Length c) myArray Length9. 在C#程序中,使用()关键字来创建数组。 (选择一项)a) newb) arrayc) staticd) this10. 在使用C#语言开发程序时,对于一组五个元素的数据(如:71、11、4、67、39),为 了把该数据按升序排序,如果采用冒泡排序法,需要比较()次。 (选择一项)a) 6b) 8c) 10d) 1611. 分析下列C#代码,最终的运行结果是()。(选择一项)using System;class Teststatic void Main()string name=”ADO.NET”;foreach(char c in name)Console.Write(c);a) nameb) ADO.NETc) 编译出错,存在语法错误d) cccc12. 多数编程语言都提供数组这种数据存储结构来存储同种类型的多个数据元素。在C#语法中有关数组定义正确的是()。(选择一项)a) int iArray = new int10;b) int iArray = new int;c) int iArray = new int10;d) int iArray = new int(10);13. 现有如下一段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();break;a) 169b) 有编译错误c) 369d) 12314. 在c#语言中,已知数组MyArray,使用冒泡排序为此数组排序,两处下划线部分应 填入的是()。 for(int i=0;i_;j+) For(int j=0;j_;j+) if(MyArrayljlMyArrayj+1) temp=MyArrayj; MyArrayj=MyArrayj+l; MyArrayj+1=temp; (选择一项) a) MyArray Length一1 MyArray Length一1一i b) MyArrayLength一1一i MyArray Length-1 c) MyArrayLength MyArray Length-i d) MyArrayLength-i MyArrayLength15. 分析下列的c#程序代码,程序运行时在控制台打印输出值为()。 static void Main(string args) int count=5: do ConsoleWrite(+count); while(count5); (选择一项) a) 5 b) 6 c) 4 d) 没有输山16.分析以下C#代码,运行后在屏幕输出的结构是()。(选择一项)Using System;Class Class1 static void Maic(string args) Int count = 8; Run(count); Console.Write(count); Private static void Run(int count) Count=count+88; Console.Write(count);a)968b)896c)9696d)编译错误17. 分析以下C#代码,编译运行结果是()。 (选一项)Using System;Class Class1Static void Main(string args) Int age=5; Run(age); Console.Wrtie(age);Private static void Run(int age) Age=age+55; Console.Write(age);a) 输出:605b) 输出:555c) 输出:506d) 编译出错18. 分析以下C#代码,运行后在屏幕输的结果是( ). ( 选择一项)Using System;Class Class1Static void Main(string args)Count =count+8;Run(count);Console.write(count);Private static void Run(int count);Count=count+88;Console.Write(count);a) 968b) 896c) 9696d) 编译错误19. 分析以下C#代码,运行后在屏幕输的结果是( ). ( 选择一项)Public class Text Int count =9;Public void count1()Count = 10;System.out.println(“count=”+count);Public void count2()System.out.println(“count=”+count);Public static void main(String args) Text t = new Tes
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号