文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 外语学习 > 英语学习 > Exercise2_Chapter3
侵权投诉

Exercise2_Chapter3

《C++程序设计》 第2次作业 班级: 姓名:

一、选择题

1、下面程序的运行结果是:c=( )。

#include<iostream.h>

void main()

{ int a=2,b=3,c;

c=a;

if (a>b) c=1;

else

if (a= =b) c=0;

else c=-1;

cout<<c;

}

A.-1 B.0 C.1 D.2

2、以下程序的输出结果是( )。

#include<iostream.h>

void main()

{ int a=100,x=10,y=20,ok1=5,ok2=0;

if(x<y)

if(y!=10)

if(!ok1) a=1;

else if(ok2) a=10;

a=-1;

cout<<a<<endl;

}

A.1 B.0 C.-1 D.值不确定

3、以下正确的if语句形式是( ) 。

A.if(x>y && x!=y); B.if (x=y) && (x!=0) x+=y;

C.if(x!=y)cin>>x else cin>>y; D.if x<y {x++;y++;}

4、当a=1,b=3,c=5,d=4时,执行下面一段程序后x的值是( )。 if(a<b)

if(c<d) x=1;

else

if(a<c)

if(b<d) x=2;

else x=3;

else x=6;

else x=7;

A.1 B.2 C3. D.6

5、有下列函数:

#include<iostream>

using namespace std;

第1页

TOP相关主题

你可能喜欢

热门文档

相关文档

  • Chapter_03(exercise)

    Chapter 4 exercise 5页 2财富值 exercise for chapter 1-2 26页 免费 Chapter 3-exercise 7页 2财富值 chapter 5 exercise 2页 免费 chapter 1-Exercise(...

  • Programming16_exercise2

    Programming15_chapter8_31/2 相关文档推荐 exercise2 10页 2财富值 Exercise2 2页 2财富值 Exercise2 1页 免费 Exercise2-1 暂无评价 10页 5财富值 ...

  • Chapter 3-exercise

    暂无评价 7页 1财富值 Chapter 4 exercise 5页 2财富值 exercise for chapter 1-2 26页 免费 chapter 5 exercise 2页 免费...

  • chapter 3 exercise

    暂无评价 7页 1财富值 Chapter 4 exercise 5页 2财富值 exercise for chapter 1-2 26页 免费 chapter 5 exercise 2页 免费...

  • Programming02_chapter3

    Programming16_exercise21/2 相关文档推荐 Programming02_chapter2 暂无评价 26页 免费 Chapter3 65页 免费 chapter3 79页 2财富值 Chapter3 85页 2财富值 ...

  • exercise chapter 1&2

    exercise chapter 1&2_英语学习_外语学习_教育专区。物流英语作业 上海海事大学Exercise Chapter 1 Introduction 1. Key Terms 1). absolute advantage An economic...

  • Chapter 2-exercise

    chapter 2 exercise 2页 1财富值 exercise chapter 1&2 7页 1财富值 exercise of Chapter 2 9页 免费 Chapter One Exercise ... 暂无评价 4页 免费 语言...

  • chapter3_American_Economy

    Chapter4 American Econ... 26页 1下载券 About American Eco... 4页 2... The government can still exercise some control over the market economy ...

  • Chapter 3-exercise

    exercise chapter 3 暂无评价 16页 免费 chapter 3 exercise 暂无评价 9页 5财富值 EXERCISE (B) OF CHAPTER ... 7页 10财富值 EXERCISE (A) OF CHAPTER...

  • chapter 5 exercise

    8B Chapter 5 Exercise 2页 1下载券 Exercise for Chapter 5... 暂无评价 2页 2下载券 Chapter 4 exercise 5页 1下载券 exercise for chapter 1... 26...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email