题目详情
当前位置:首页 > 学历类考试 > C#程序设计
题目详情:
发布时间:2023-10-17 00:43:22

[单项选择]以下程序的输出为()
#include
void main(){inty=5;while(y--);printf("y=%d/n",y);}


A. y=0
B. 无限循环,无结果输出
C. y=1
D. y=-1

更多"以下程序的输出为() #include void main(){int"的相关试题:

[单项选择]有以下程序:
#include
void main()
{while(putchar(getchar())!=’?’);}
当输入"hello?"时,程序的执行结果是()


A. hello
B. dijob
C. dijob?
D. hello?
[单项选择]下面程序段输出的i值是()
#include
void main()
{int i;for(i=1;i<=50;i++)
if((i*i>=130)&(i*i<=180))break;
printf("%d/n",i);}


A. 10
B. 11
C. 12
D. 13
[单项选择] 程序: class TestApp{ public static void main (String[] args){ int x=6; if (x>l) System. out. println("x>l"); else if (x>5) System. out .println("x>5"); else if (x<10) System. out. println("xA. x>5
B. x>l
C. x<10
D. x<29
[单项选择]

若有以下程序
#include
void f(int n)
main()
{
void f(int n);
f(5);
}
void f(int n);
{
printf("%d/n",n);
}
则以下叙述不正确的是()


A. 若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B. 若在主函数前对函数f进行说明,则在主函数和其它函数中都可以正确调用函数f
C. 对于以上程序,编译时系统会出提示出错信息:提示对f函数重复说明
D. 函数f无返回值,所以可用void将其类型定义为无值型
[单项选择] public classYippee{ public static void main(String[]args){ for(intx=1;xSystem.out.print(args[x]+""); } } } and two separate command line invocations:j avaYippee javaYippee1234 What is the result?()
A. No output is produced.       123
B. No output is produced.        234
C. No output is produced.       1234
D. An exception is thrown at runtime.        123
E. An exception is thrown at runtime.         234
F. An exception is thrown at runtime.        1234
[单项选择] public class Test{ public static void main(String[]args){ intx=5; boolean b1=true; boolean b2=false; if((x==4)&&!b2) System.out.print("l"); System.out.print("2"); if((b2=true)&&b1) System.out.print("3"); } } What is the result?()
A. 2
B. 3
C. 12
D. 23
E. 123
F. Compilation fails.
G. An exceptional ist hrown at runtime.
[单项选择] 现有: class TestApp{ public static void main (String[] args){ for (int i=0; iA. 0123
B. 012456789
C. 0123456789
D. 012
[单项选择]现有:class Test2 fpublic static void main (String [] args) {short a,b,C;a=1;b=2;C=a+b;a+=2;}}以上代码中,哪一句是错误的?()
A. a=1;
B. C=a+b;
C. a+=2;
D. shorta,b,C;
[单项选择]"以下程序输出结果是main(){intm=5;if(m++>5print(""%d/n"",m);elseprintf(""%d/n"",m--);}
A. 7
B. 6
C. 5
D. 4
[多项选择]public static void main方法的参数描述是()。
A. String args[]
B. String[] args
C. Strings args[]z
D. String args
[单项选择]

以下程序的输出结果是()。
int a,b;
void fun()
{
a=100;
b=200;
}
main()
{
int a=5,b=7;
fun();
printf("%d%d/n",a,b);
}


A. 100200
B. 57
C. 200100
D. 75
[单项选择] public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()
A. null
B. zero
C. some
D. Compilationfails.
E. Anexceptionisthrownatruntime.
[多项选择]public static void main方法的参数描述正确的有()。
A. String args[]
B. String[] args
C. Strings args[]z
D. String args
E. Strings arg[]
[单项选择] public static void main(String[]args){ Integer i=new Integer(1)+new Integer(2); switch(i){ case3:System.out.println("three");break; default:System.out.println("other");break; } } Whatistheresult?()
A. three
B. other
C. Anexceptionisthrownatruntime.
D. Compilationfailsbecauseofanerroronline12.
E. Compilationfailsbecauseofanerroronline13.
F. Compilationfailsbecauseofanerroronline15.
[单项选择] 现有: 1. class Wrench f 2.public static void main(String [] args) { 3.Wrench w=new Wrench( ); Wrench w2=new Wrench( ); 4. w2=go (w, w2); 5.System.out.print (w2==w); 6. } 7.static Wrench go (Wrench wrl, Wrench wr2) { 8.Wrench wr3=wrl; wrl=wr2; wr2=wr3; 9. return wr3; 10. } 11. } 结果是什么?()
A. false
B. true
C. 编译失败
D. 运行的时候有异常抛出
[单项选择]

以下程序的输出结果是()。
#include
main()
{
int a=2,c=5;
printf("a=%%d,b=%%d/n",a,c);
}


A. a=%2,b=%5
B. a=2,b=5
C. a=%%d,b=%%d
D. a=%d,b=%d
[单项选择]

有以下程序
void sum(int a[])
{
a[0]=a[-1]+a[1];
}
main()
{
int a[10]={1,2,3,4,5,6,7,8,9,10};
sum(&a[2]);
printf("%d/n",a[2]);
}
程序运行后输出结果是()


A. 6
B. 7
C. 5
D. 8

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码