重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 自考
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[主观题]

有如下程序:#include<stdio.h>main(){int a=2,b= -1,c=2; if(a<b) if(b<0)c=0; elsec++; printf(

有如下程序: #include <stdio.h> main() { int a=2,b= -1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是

A.0

B.1

C.2

D.3

答案
查看答案
更多“有如下程序:#include<stdio.h>main(){int a=2,b= -1,c=2; if(a<b) if(b<0)c=0; elsec++; printf(”相关的问题

第1题

有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3;intt=0;if(n%2){ stat

有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。

A.26

B.28

C.29

D.24

点击查看答案

第2题

以下程序运行后的输出结果是【 】。 include <stdio, h> main() char c1 ,c2; for(e

以下程序运行后的输出结果是【 】。 include <stdio, h> main() char c1 ,c2; for(el = 0, c2 =9; e1<c2; c1 + + , c2 -- ) printf(" %c%c", c1, c2 ); printf("\n" ); }

点击查看答案

第3题

请补充main函数,该函数的功能是:打印届1~1000中满足:个位数字的立方等于其本身所有数。 本题的结

请补充main函数,该函数的功能是:打印届1~1000中满足:个位数字的立方等于其本身所有数。

本题的结果为;1 64 125 216 729

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数main的横线上填入所编写的若干表达式或语句。

试题程序:

include <stdio .h>

main ()

{

int i,g;

clrscr ();

for (i=1; i<1000; i++)

{

g=【 】;

if(【 】)

printf ("%4d", i);

}

}

点击查看答案

第4题

下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。#include "stdio

下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。

#include "stdio.h"

main()

{char c;

while((c=getchar())!='\n')

{if(c>='a'&&c<='z')

c=c-30;

if(c>'z'||c<='z'+2)

c=c-26;}

printf("%c",c);

}

错误:______

改正:______

参考答案:错误

点击查看答案

第5题

以下程序从终端读入数据到数组中,统计其中正数的个数,并计算它们之和,请填空。 include <s
tdio, h> main() int i, a [20], sum, count; sum = count = 0 ; for(i=0;i<20;i++)scanf("%d",【 】); for(i=0;i<20;i ++) {if(a[i] >0) { count + +; sum+ = 【 】; } prinff("sum = % d, count = % d \ n", sum, count ); }

点击查看答案

第6题

有如下程序:#include<iostream>using namespace std;class B{public:Virtual void show(){cout<<

有如下程序: #include<iostream> using namespace std; class B{ public: Virtual void show(){cout<<“B”;} }; class D:publicB{ public: void show(){cout<<“D”;} }; void funl(B*ptr){ptr->show();} void{un2(B&ref){ref.show();} void

A.BBB

B.BBD

C.DBB

D.DBD

点击查看答案

第7题

有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <st

有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <stdio.h> include "myfun.c" main() { fun(); prinff("\n"); } myfun.c文件如下: void fun() { char s[80],c;int n=0; while((c=getchar())! :\n) s[n++] =c; n--; while (n>=0) prinff("%c" , s [n--] ); } 当编译连接通过后,运行程序T18时,输入"Thank!”,则输出结果是【 】。

点击查看答案

第8题

有如下程序 #include<iostream.h> #define N2 #define M N+1 #define NUM 2*M+1 void main() { int i; for(i=1,i<= NUM;i++) cout<<i;} 该程序中的for循环执行的次数是

A.5

B.6

C.7

D.8

点击查看答案

第9题

有如下程序:#include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-

有如下程序: #include<iostream> using namespace std; class Test{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行后的输出结果是()

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案

第10题

如下程序的输出结果是什么#include<stdio.h>int main(void){int aaa=0;aaa=011;printf("%d",aaa);return 0;}()

A.011

B.11

C.9

D.%d

点击查看答案

第11题

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"adc"); Strcpy(&S[1],"def"); strcpy(&S[2],"gh");; printf("%S\n",s); 则程序运行后的输出结果是【 】。

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝