在时间轴上捏(悬疑:25Jul05)请求协助 - Q1 [英] In a timeline pinch (Suspense: 25Jul05) pleading for assistance - Q1

查看:55
本文介绍了在时间轴上捏(悬疑:25Jul05)请求协助 - Q1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

研究员,


正如你们中的一位所指出的那样,我已经参加了3个在线课程(2个已经完成)

并且已经运行进入时间紧缩。我在2004年10月开始学习这些课程,但是在工作(美国陆军在DC),照顾我的妻​​子(因为* b $ b狼疮并发症而导致的中风)和&女儿(4),并准备转移/部署

(我的继子, - 23,说他会在我不在的时候照顾他们)。我已经花了很少的时间用于其他任何事情。


我将非常感谢您的帮助。当然,这不是正确的b
方法,但是剩下的时间需要紧急的解决方案。


非常恭敬,

Daniel


1.以下哪项通常表明程序无法读取
的输入?


a。 ''\ n''

b。 ''\'''

c。结束

d。 EOF

2.以下代码有什么影响?

char Ch;

Ch =''7'';

printf("%d \ n",Ch);


a。它会导致错误

b。它将打印出计算机内部代码,用于字符7

c。它将打印出字符7

d。它将打印出内部代码为7的字符。

3.以下代码的作用是什么?

char Ch;

while ((Ch = getchar())!='';'')

putchar(Ch);


a。它会读取和写入字符,直到除了;读了。

b。它将读取包括第一个分号在内的字符,并且

写入字符,但不包括第一个分号。

c。它会读取和写入字符,但不包括第一个

分号。

d。它将跳过第一个分号的字符,然后写下一个

字符。

4.必须使用int而不是char来处理

字符:


a。每当对角色进行计算时。

b。每当进行EOF测试时。

c。每当角色作为参数传递给一个函数时。

d。永远不需要使用int来进行字符处理。

5.以下代码输出的字符是什么:


char Ch =''/' ';

while(Ch!=''d'')

{

putchar(Ch);

Ch = getchar();

}


给出以下输入? abcdefghi


a。 abc

b。 d $ / $
c。 / abc

d。 / efghi

6.以下代码有什么影响?


char Ch;

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

putchar('''');


a。它在每个字符后读取和写入一行空格。

b。它读取一行但只输出空白。

c。它读取一行然后输出一个空白。

d。它读取和写入一行,所有空格都替换为换行符。

7.通常,当int与表达式中的long组合时,

结果为:


a。 int

b。很长

c。双倍

d。语法错误

8.给出以下声明:


int N;

char C;

浮动X;


表达式C + N * X的类型是什么?


a。 char

b。 int

c。漂浮

d。表达式包含语法错误

9.给出以下声明和初始化:


int i = 1;

int x = 2.0;


表达式i / x的值和类型是什么?


a。 .5双

b。 .5 int

c。 0.0浮动

d。 0 int

10.给出以下声明和初始化:


int n = 8;

int z = 2.0;


表达式的值和类型是什么?z = n?


a。 8 int

b。 8浮动

c。 8双

d。 8未签名

a。 int表达式总是精确计算;但浮动表达式可以

遭受舍入错误

b。 float表达式总是精确计算;但是int表达式可以

遭受舍入错误

c。 int和float表达式都会遭受舍入错误

d。 int和float表达式将始终精确计算

12.给出以下声明:


int N;

float X ;


表达式X%N的类型是什么?


a。 int

b。漂浮

c。双倍

d。不能使用浮点数%

13.选择定义枚举类型模糊的C语句

由值false,maybe和true组成。定义为可能比价值更高而不是真实的价值更高。


a。 enum fuzzy {false,maybe,true};

b。 enum fuzzy {true,false,maybe};

c。 enum fuzzy {false,maybe,true}

d。 enum fuzzy {true,maybe,false};

14.鉴于下面的类型定义:


枚举颜色{红色,黄色,绿色,蓝色};


表达式(int)蓝色的值是多少?


a。 2

b。 3

c。 4

d。蓝色

15.以下哪个语句为

定义的枚举类型的变量分配空间?


a。枚举颜色{红色,黄色,蓝色}颜料;

b。枚举颜色{红色,黄色,蓝色};

c。枚举{红色,黄色,蓝色}油漆;

d。 a和c

回答问题16和17给出int变量的以下值

X和Y


X = 1100110000110011

Y = 0000111100001010

16. X<<<<<<<<<<<<<<<" 5 1000011001100000

b。 1000011001111111

c。 0000110011000000

d。 0000110011111111

17. -Y(负Y)的两个补码是什么?


a。 0000111100001010

b。 1111000011110101

c。 1111000011110110

d。 1100000000110001

18.如果X是一个int变量,我们对X& X的值有什么了解?


a。它总是等于X.

b。它总是大于1.

c。它总是等于零。

d。它始终等于1.

19.指针变量包含:


a。一个整数。

b。另一个变量的地址。

c。任何数据类型。

d。字符串。

20.术语解除引用。意思是:


a。取另一个变量的地址。

b。删除变量。

c。在给定地址的情况下检索变量的值。

d。对指针变量进行赋值。

21.以下哪个陈述适用于以下声明:


int n = 5,* p = & n;


a。 p是一个初始化为指向n的指针。

b。 p是一个初始化为值5的指针。

c。 n和p都是指针变量。

d。声明包含语法错误

22.按引用调用是:


a。不适用于C.

b。通过将正式参数声明为指针来完成。

c。完成后使用取消引用的指针作为参数。

d。通过在形式参数中放置一个&符号来完成。

23.如果你想要一个函数内声明的变量保留其先前的

值,当块是重新进入,你应该使用什么类型的存储类?
使用?


a。汽车

b。静态

c。注册

d。 extern

24.地址运营商&不能适用于以下哪一项?


a。常数

b。表达

c。班级登记的变量

d。以上所有

25.写下以下代码产生的输出:


int x = 5,y = 6,* p =& x ,* q =& y;

x = * q;

* p = * q + 2;

* q = x;

printf("%d%d%d%d \ n",x,y,* p,* q);


a。 8 8 8 8

b。 5 6 5 6

c。 6 8 5 6

d。 6 8 6 8

Daniel Antonson <安******** @ comcast.net>在留言中写道

news:mp ******************** @ comcast.com ...

什么是以下代码的效果?

char Ch;

while((Ch = getchar())!='';'')

putchar(Ch);

它会读取和写入字符,直到除了;是的。

b。它将读取包括第一个分号在内的字符,

并写入字符,但不包括第一个分号。

c。它会读取和写入字符,但不包括第一个分号。

d。它将跳过第一个分号的字符,然后写下

下一个字符。



解决方案

丹尼尔:


我不知道我的答案就在我的头顶,这里

是我要提供的是什么(?????意味着我绝对没有

知道 - 仔细检查我给别人做的答案,其中一些

问题有点棘手 - 希望这有帮助):

1)d。

2)b。

3)a。

4)d。

5)c。

6)b。

7)b。

8)c。

9)d。

10)a。

11)a。

12)???????????

13)a。

14)b。

)b。

16)a。

17)???????????

18)a 。

19)b。

20)c。

21)a。

22)??? ???????

23)b。

24)d。

25)b。

John


Daniel Antonson <安******** @ comcast.net>在消息中写道

新闻:ep ******************** @ comcast.com ...

研究员程序员,

正如你们其中一个人指出的那样,我已经参加了3个在线课程(其中2个已完成)
并且遇到了时间紧迫。我在10月开始这些课程,
但是在工作之间(美国陆军在DC),照顾我的妻​​子(由于狼疮并发症而在2003年12月中风)&女儿(4),并准备转移/部署
(我的继子, - 23,说他会在我不在的时候照顾他们)。我没有时间做其他事情。

我非常感谢你的帮助。当然,这不是正确的方法,但剩下的时间需要紧急的解决方案。

非常尊重,
Daniel
1.以下哪项通常表明没有更多的输入可以被程序读取?

a。 ''\ n''
b。 ''\'''
c。结束
d。 EOF

2.以下代码有什么影响?
char Ch;
Ch ='''7'';
printf("%d \\ \\ n,Ch);

这会导致错误
b。它将打印出计算机内部代码的字符
''7''
c。它将打印出字符7。
d。它将打印出内部代码为7的字符。

3.以下代码的作用是什么?
char Ch;
while((Ch = getchar()) !='';'')
putchar(Ch);

a。它将读取和写入字符,直到读取除
之外的其他内容。
b。它将读取包括第一个分号在内的字符,

写入字符,但不包括第一个分号。
c。它会读取和写入字符,但不包括
第一个分号。
d。它将跳过第一个分号的字符,然后写下
字符。

4.必须使用int而不是char来处理
每当对角色进行计算时。
b。每当进行EOF测试时。
c。每当角色作为参数传递给一个函数时。
d。永远不需要使用int进行字符处理。

5.以下代码输出的字符是什么:

char Ch =''/'';
while(Ch!=''d'')
{
putchar(Ch);
Ch = getchar();
}

给出以下输入? abcdefghi

abc
b。 d
c。 / abc
d。 / efghi

6.以下代码有什么影响?

char Ch;
while((Ch = getchar())!=''\\ \\ n'')
putchar('''');

在每个
字符后,它只读取和写入一行空格。
b。它读取一行但只输出空白。
c。它读取一行然后输出一个空白。
d。它读取和写入一行,所有空格替换为
换行符。

7.一般情况下,当int与表达式中的long组合时,
结果是:

int
b。很长
c。双d /> d。语法错误

8.给出以下声明:

int N;
char C;
浮动X;

表达式C + N * X的类型是什么?

a。 char
b。 int
c。漂浮
d。表达式包含语法错误

9.给出以下声明和初始化:

int i = 1;
int x = 2.0;

表达式i / x的价值和类型是什么?

a。 .5双
b。 .5 int
c。 0.0浮动
d。 0 int

10.给出以下声明和初始化:

int n = 8;
int z = 2.0;

是表达式的值和类型z = n?

a。 8 int
b。 8浮动
c。 8双
d。 8未签名

11.以下哪项陈述属实?
a。 int表达式总是精确计算;但浮动
表达式可能会遭遇四舍五入的错误
b。 float表达式总是精确计算;但int
表达式可能会遭遇四舍五入的错误
c。 int和float表达式都会遭受舍入错误。 int和float表达式将始终精确计算

12.给出以下声明:

int N;
浮动X;

X%N表达式的类型是什么?

int
b。漂浮
c。双d /> d。不能使用浮点数%

13.选择定义枚举类型模糊的C语句
由值false,maybe和true组成。定义为可能
比价值更高而不是真实。

a。 enum fuzzy {false,maybe,true};
b。 enum fuzzy {true,false,maybe};
c。 enum fuzzy {false,maybe,true}
d。 enum fuzzy {true,maybe,false};

14.鉴于下面的类型定义:

枚举颜色{红色,黄色,绿色,蓝色};

表达式(int)蓝色的值是多少?

2
b。 3
c。 4
d。蓝色

15.以下哪个语句为
定义的枚举类型的变量分配空间?

a。枚举颜色{红色,黄色,蓝色}涂料;
b。枚举颜色{红色,黄色,蓝色};
c。 enum {red,yellow,blue} paint;
d。 a和c

回答问题16和17给出以下值为int
变量
X和Y

X = 1100110000110011
Y = 0000111100001010

16. X<< 5的二进制表示是什么?

a。 1000011001100000
b。 1000011001111111
c。 0000110011000000
d。 0000110011111111

17. -Y(负Y)的两个补码是什么?

a。 0000111100001010
b。 1111000011110101
c。 1111000011110110
d。 1100000000110001

18.如果X是一个int变量,我们对X& X的值有什么了解?

a。它总是等于X.
b。它总是大于1.
c。它总是等于零。
d。它始终等于1.

19.指针变量包含:

a。整数。
b。另一个变量的地址。
c。任何数据类型。
d。字符串。

20.术语解除引用。意思是:

取另一个变量的地址。
b。删除变量。
c。在给定地址的情况下检索变量的值。
d。对指针变量进行赋值。

21.以下哪些陈述适用于以下
声明:

int n = 5,* p = & n;

p是一个初始化为指向n的指针。
b。 p是一个初始化为值5的指针。
c。 n和p都是指针变量。
d。声明包含语法错误

22.按引用标记是:

a。不适用于C.
b。通过将正式参数声明为指针来完成。
c。完成后使用取消引用的指针作为参数。
d。通过在形式参数中放置一个&符号来完成。

23.如果你想在一个函数内声明一个变量来保留它的
之前的值,当块是重新进入,你应该使用什么类型的存储类?

汽车
b。静电
c。注册
d。 extern

24.地址运营商&不能适用于以下哪个?

常数
b。表达
c。类寄存器的变量
d。以上所有

25.写下以下代码产生的输出:

int x = 5,y = 6,* p =& x,* q = & y;
x = * q;
* p = * q + 2;
* q = x;
printf("%d%d%d%d \ n",x,y,* p,* q);

a。 8 8 8 8
b。 5 6 5 6
c。 6 8 5 6
d。 6 8 6 8

Daniel Antonson <安******** @ comcast.net>在消息中写道
新闻:mp ******************** @ comcast.com ...

有什么影响以下代码?

char Ch;

while((Ch = getchar())!='';'')

putchar( Ch);

它将读取和写入字符,直到读取其他内容为止。

b。它将读取包括第一个分号在内的字符,

并写入字符,但不包括第一个分号。

c。它会读取和写入字符,但不包括
第一个分号。

d。它将跳过第一个分号的字符,然后写下

下一个字符。






" Daniel Antonson" <安******** @ comcast.net>在消息中写道

新闻:ep ******************** @ comcast.com ...

研究员程序员,

正如你们中的一位指出的那样,我已经参加了3个在线课程(2个已经完成)
并且遇到了时间紧迫。我在2004年10月开始学习这些课程,但是在工作之间(美国陆军在DC),照顾我的妻​​子(由于狼疮并发症引起的2003年12月中风)&女儿(4),并准备转移/部署
(我的继子, - 23,说他会在我不在的时候照顾他们)。我没有时间做其他事情。

我非常感谢你的帮助。当然,这不是正确的方法,但剩下的时间需要紧急的解决方案。

非常尊重,
Daniel



是的,我同意。这不是正确的方法。


没有多少困难证明我们只是给你答案你的
家庭作业。此外,它不会帮助你,它不会帮助其他任何人,如果你只需要给你答案就可以通过课程。


拜托,请不要给他答案!


-Howard


丹尼尔:


在考虑了一下之后,我最好的猜测是我最初没有回答的问题是:

12 )d。

17)b。

22)b。


John


Daniel Antonson <安******** @ comcast.net>在消息中写道

新闻:ep ******************** @ comcast.com ...

研究员程序员,

正如你们其中一个人指出的那样,我已经参加了3个在线课程(其中2个已完成)
并且遇到了时间紧迫。我在10月开始这些课程,
但是在工作之间(美国陆军在DC),照顾我的妻​​子(由于狼疮并发症而在2003年12月中风)&女儿(4),并准备转移/部署
(我的继子, - 23,说他会在我不在的时候照顾他们)。我没有时间做其他事情。

我非常感谢你的帮助。当然,这不是正确的方法,但剩下的时间需要紧急的解决方案。

非常尊重,
Daniel
1.以下哪项通常表明没有更多的输入可以被程序读取?

a。 ''\ n''
b。 ''\'''
c。结束
d。 EOF

2.以下代码有什么影响?
char Ch;
Ch ='''7'';
printf("%d \\ \\ n,Ch);

这会导致错误
b。它将打印出计算机内部代码的字符
''7''
c。它将打印出字符7。
d。它将打印出内部代码为7的字符。

3.以下代码的作用是什么?
char Ch;
while((Ch = getchar()) !='';'')
putchar(Ch);

a。它将读取和写入字符,直到读取除
之外的其他内容。
b。它将读取包括第一个分号在内的字符,

写入字符,但不包括第一个分号。
c。它会读取和写入字符,但不包括
第一个分号。
d。它将跳过第一个分号的字符,然后写下
字符。

4.必须使用int而不是char来处理
每当对角色进行计算时。
b。每当进行EOF测试时。
c。每当角色作为参数传递给一个函数时。
d。永远不需要使用int进行字符处理。

5.以下代码输出的字符是什么:

char Ch =''/'';
while(Ch!=''d'')
{
putchar(Ch);
Ch = getchar();
}

给出以下输入? abcdefghi

abc
b。 d
c。 / abc
d。 / efghi

6.以下代码有什么影响?

char Ch;
while((Ch = getchar())!=''\\ \\ n'')
putchar('''');

在每个
字符后,它只读取和写入一行空格。
b。它读取一行但只输出空白。
c。它读取一行然后输出一个空白。
d。它读取和写入一行,所有空格替换为
换行符。

7.一般情况下,当int与表达式中的long组合时,
结果是:

int
b。很长
c。双d /> d。语法错误

8.给出以下声明:

int N;
char C;
浮动X;

表达式C + N * X的类型是什么?

a。 char
b。 int
c。漂浮
d。表达式包含语法错误

9.给出以下声明和初始化:

int i = 1;
int x = 2.0;

表达式i / x的价值和类型是什么?

a。 .5双
b。 .5 int
c。 0.0浮动
d。 0 int

10.给出以下声明和初始化:

int n = 8;
int z = 2.0;

是表达式的值和类型z = n?

a。 8 int
b。 8浮动
c。 8双
d。 8未签名

11.以下哪项陈述属实?
a。 int表达式总是精确计算;但浮动
表达式可能会遭遇四舍五入的错误
b。 float表达式总是精确计算;但int
表达式可能会遭遇四舍五入的错误
c。 int和float表达式都会遭受舍入错误。 int和float表达式将始终精确计算

12.给出以下声明:

int N;
浮动X;

X%N表达式的类型是什么?

int
b。漂浮
c。双d /> d。不能使用浮点数%

13.选择定义枚举类型模糊的C语句
由值false,maybe和true组成。定义为可能
比价值更高而不是真实。

a。 enum fuzzy {false,maybe,true};
b。 enum fuzzy {true,false,maybe};
c。 enum fuzzy {false,maybe,true}
d。 enum fuzzy {true,maybe,false};

14.鉴于下面的类型定义:

枚举颜色{红色,黄色,绿色,蓝色};

表达式(int)蓝色的值是多少?

2
b。 3
c。 4
d。蓝色

15.以下哪个语句为
定义的枚举类型的变量分配空间?

a。枚举颜色{红色,黄色,蓝色}涂料;
b。枚举颜色{红色,黄色,蓝色};
c。 enum {red,yellow,blue} paint;
d。 a和c

回答问题16和17给出以下值为int
变量
X和Y

X = 1100110000110011
Y = 0000111100001010

16. X<< 5的二进制表示是什么?

a。 1000011001100000
b。 1000011001111111
c。 0000110011000000
d。 0000110011111111

17. -Y(负Y)的两个补码是什么?

a。 0000111100001010
b。 1111000011110101
c。 1111000011110110
d。 1100000000110001

18.如果X是一个int变量,我们对X& X的值有什么了解?

a。它总是等于X.
b。它总是大于1.
c。它总是等于零。
d。它始终等于1.

19.指针变量包含:

a。整数。
b。另一个变量的地址。
c。任何数据类型。
d。字符串。

20.术语解除引用。意思是:

取另一个变量的地址。
b。删除变量。
c。在给定地址的情况下检索变量的值。
d。对指针变量进行赋值。

21.以下哪些陈述适用于以下
声明:

int n = 5,* p = & n;

p是一个初始化为指向n的指针。
b。 p是一个初始化为值5的指针。
c。 n和p都是指针变量。
d。声明包含语法错误

22.按引用标记是:

a。不适用于C.
b。通过将正式参数声明为指针来完成。
c。完成后使用取消引用的指针作为参数。
d。通过在形式参数中放置一个&符号来完成。

23.如果你想在一个函数内声明一个变量来保留它的
之前的值,当块是重新进入,你应该使用什么类型的存储类?

汽车
b。静电
c。注册
d。 extern

24.地址运营商&不能适用于以下哪个?

常数
b。表达
c。类寄存器的变量
d。以上所有

25.写下以下代码产生的输出:

int x = 5,y = 6,* p =& x,* q = & y;
x = * q;
* p = * q + 2;
* q = x;
printf("%d%d%d%d \ n",x,y,* p,* q);

a。 8 8 8 8
b。 5 6 5 6
c。 6 8 5 6
d。 6 8 6 8

Daniel Antonson <安******** @ comcast.net>在消息中写道
新闻:mp ******************** @ comcast.com ...

有什么影响以下代码?

char Ch;

while((Ch = getchar())!='';'')

putchar( Ch);

它将读取和写入字符,直到读取其他内容为止。

b。它将读取包括第一个分号在内的字符,

并写入字符,但不包括第一个分号。

c。它会读取和写入字符,但不包括
第一个分号。

d。它将跳过第一个分号的字符,然后写下

下一个字符。




Fellow programmers,

As one of you pointed out, I''ve been taking 3 online courses (2 are done)
and have run into a time crunch. I started these courses in Oct04, but
between work (US Army in DC), caring for my wife (stroke in Dec03 due to
lupus complications) & daughter (4), and preparing for transfer/deployment
(my stepson,- 23, says he''ll care for them during my absence). I''ve had
little time for anything else.

I would greatly appreciate your assistance. Granted, it isn''t the proper
approach, but the time
remaining demands urgent solutions.

very respectfully,
Daniel

1. Which of the following usually indicates that there is no more input to
be read by a program?

a. ''\n''
b. ''\0''
c. END
d. EOF
2. What is the effect of the following code?
char Ch;
Ch = ''7'';
printf("%d\n", Ch);

a. It will cause an error
b. It will print out the computer''s internal code for the character ''7''
c. It will print out the character ''7''
d. It will print out the character whose internal code is 7
3. What is the effect of the following code?
char Ch;
while ((Ch=getchar() ) != '';'')
putchar (Ch);

a. It will read and write characters until something other than a ; is read.
b. It will read characters up to and including the first semicolon, and
write characters up to but not including the first semicolon.
c. It will read and write characters up to but not including the first
semicolon.
d. It will skip characters up to the first semicolon, then write the next
character.
4. It is necessary to use an int instead of a char for processing a
character:

a. whenever a computation is performed on the character.
b. whenever a test for EOF is made.
c. whenever the character is passed as a parameter to a function.
d. It is never necessary to use an int for character processing.
5. What characters are output by the following code:

char Ch=''/'';
while (Ch != ''d'')
{
putchar(Ch);
Ch = getchar();
}

given the following input? abcdefghi

a. abc
b. d
c. /abc
d. /efghi
6. What is the effect of the following code?

char Ch;
while ((Ch = getchar()) != ''\n'')
putchar('' '');

a. It reads and writes exactly one line with a blank after each character.
b. It reads one line but outputs only blanks.
c. It reads a line and then outputs one blank.
d. It reads and writes one line with all blanks replaced by newlines.
7. In general, when an int is combined with a long in an expression, the
result is:

a. int
b. long
c. double
d. A syntax error
8. Given the following declarations:

int N;
char C;
float X;

what is the type of the expression C+N*X?

a. char
b. int
c. float
d. The expression contains a syntax error
9. Given the following declarations and initialization:

int i = 1;
int x = 2.0;

What is the value and type of the expression i/x?

a. .5 double
b. .5 int
c. 0.0 float
d. 0 int
10. Given the following declarations and initializations:

int n = 8;
int z = 2.0;

What is the value and type of the expression z=n?

a. 8 int
b. 8 float
c. 8 double
d. 8 unsigned
11. Which of the following statements is true?
a. int expressions are always computed exactly; but float expressions can
suffer round-off error
b. float expressions are always computed exactly; but int expressions can
suffer round-off error
c. Both int and float expressions can suffer round-off error
d. Both int and float expressions will always be computed exactly
12. Given the following declarations:

int N;
float X;

what is the type of the expression X%N?

a. int
b. float
c. double
d. can''t use float with %
13. Choose the C statement which defines an enumeration type fuzzy
consisting of values false, maybe, and true. Defined so that maybe is
greater in value than false but less than true.

a. enum fuzzy {false, maybe, true};
b. enum fuzzy {true, false, maybe};
c. enum fuzzy {false, maybe, true}
d. enum fuzzy {true, maybe, false};
14. Given the type definition below:

enum color {red, yellow, green, blue};

what is the value of the expression (int) blue?

a. 2
b. 3
c. 4
d. blue
15. Which of the following statements allocates space for a variable of the
defined enum type?

a. enum color {red, yellow, blue} paint;
b. enum color {red, yellow, blue};
c. enum {red, yellow, blue} paint;
d. a and c
Answer questions 16 and 17 given the following values for the int variables
X and Y

X=1100110000110011
Y=0000111100001010
16. What is the binary representation of X<<5?

a. 1000011001100000
b. 1000011001111111
c. 0000110011000000
d. 0000110011111111
17. What is the two''s complement of -Y (negative Y)?

a. 0000111100001010
b. 1111000011110101
c. 1111000011110110
d. 1100000000110001
18. If X is an int variable, what do we know about the value of X&X?

a. It is always equal to X.
b. It is always greater than 1.
c. It is always equal to zero.
d. It is always equal to 1.
19. A pointer variable contains:

a. an integer.
b. the address of another variable.
c. any data type.
d. a character string.
20. The term "dereferencing" means:

a. taking the address of another variable.
b. deleting a variable.
c. retrieving the value of a variable given its address.
d. making an assignment to a pointer variable.
21. Which of the statements below is true of the following declaration:

int n=5, *p=&n;

a. p is a pointer initialized to point to n.
b. p is a pointer initialized to the value 5.
c. n and p are both pointer variables.
d. The declaration contains a syntax error
22. Call-by-reference is:

a. not available in C.
b. accomplished by declaring a formal parameter to be a pointer.
c. accomplished be using a de-referenced pointer as a parameter.
d. accomplished by putting an ampersand (&) in the formal parameter.
23. If you want a variable declared inside a function to retain its previous
value when the block is re-entered, what type of storage class should you
use?

a. auto
b. static
c. register
d. extern
24. The address operator & cannot be applied to which of the following?

a. constants
b. expressions
c. variables of class register
d. All of the above
25. Write the output produced by the following code:

int x=5, y=6, *p=&x, *q=&y;
x=*q;
*p = *q + 2;
*q=x;
printf("%d %d %d %d\n", x, y, *p, *q);

a. 8 8 8 8
b. 5 6 5 6
c. 6 8 5 6
d. 6 8 6 8
"Daniel Antonson" <An********@comcast.net> wrote in message
news:mp********************@comcast.com...

What is the effect of the following code?

char Ch;

while ((Ch=getchar() ) != '';'')

putchar (Ch);

a. It will read and write characters until something other than a ; is
read.

b. It will read characters up to and including the first semicolon,

and write characters up to but not including the first semicolon.

c. It will read and write characters up to but not including the first
semicolon.

d. It will skip characters up to the first semicolon, then write the

next character.




解决方案

Daniel:

Just off the top of my head, without checking any of my answers, here
is what I have to offer (the ????? means I DEFINENTLY do not
know--double check the answers I did give against others,some of those
questions are a bit tricky--hope this helps):
1) d.
2) b.
3) a.
4) d.
5) c.
6) b.
7) b.
8) c.
9) d.
10) a.
11) a.
12) ????????????????
13) a.
14) b.
15) b.
16) a.
17) ????????????
18) a.
19) b.
20) c.
21) a.
22) ??????????
23) b.
24) d.
25) b.

John

"Daniel Antonson" <An********@comcast.net> wrote in message
news:ep********************@comcast.com...

Fellow programmers,

As one of you pointed out, I''ve been taking 3 online courses (2 are
done)
and have run into a time crunch. I started these courses in Oct04,
but
between work (US Army in DC), caring for my wife (stroke in Dec03
due to
lupus complications) & daughter (4), and preparing for
transfer/deployment
(my stepson,- 23, says he''ll care for them during my absence). I''ve
had
little time for anything else.

I would greatly appreciate your assistance. Granted, it isn''t the
proper
approach, but the time
remaining demands urgent solutions.

very respectfully,
Daniel

1. Which of the following usually indicates that there is no more
input to
be read by a program?

a. ''\n''
b. ''\0''
c. END
d. EOF
2. What is the effect of the following code?
char Ch;
Ch = ''7'';
printf("%d\n", Ch);

a. It will cause an error
b. It will print out the computer''s internal code for the character
''7''
c. It will print out the character ''7''
d. It will print out the character whose internal code is 7
3. What is the effect of the following code?
char Ch;
while ((Ch=getchar() ) != '';'')
putchar (Ch);

a. It will read and write characters until something other than a ;
is read.
b. It will read characters up to and including the first semicolon,
and
write characters up to but not including the first semicolon.
c. It will read and write characters up to but not including the
first
semicolon.
d. It will skip characters up to the first semicolon, then write the
next
character.
4. It is necessary to use an int instead of a char for processing a
character:

a. whenever a computation is performed on the character.
b. whenever a test for EOF is made.
c. whenever the character is passed as a parameter to a function.
d. It is never necessary to use an int for character processing.
5. What characters are output by the following code:

char Ch=''/'';
while (Ch != ''d'')
{
putchar(Ch);
Ch = getchar();
}

given the following input? abcdefghi

a. abc
b. d
c. /abc
d. /efghi
6. What is the effect of the following code?

char Ch;
while ((Ch = getchar()) != ''\n'')
putchar('' '');

a. It reads and writes exactly one line with a blank after each
character.
b. It reads one line but outputs only blanks.
c. It reads a line and then outputs one blank.
d. It reads and writes one line with all blanks replaced by
newlines.
7. In general, when an int is combined with a long in an expression,
the
result is:

a. int
b. long
c. double
d. A syntax error
8. Given the following declarations:

int N;
char C;
float X;

what is the type of the expression C+N*X?

a. char
b. int
c. float
d. The expression contains a syntax error
9. Given the following declarations and initialization:

int i = 1;
int x = 2.0;

What is the value and type of the expression i/x?

a. .5 double
b. .5 int
c. 0.0 float
d. 0 int
10. Given the following declarations and initializations:

int n = 8;
int z = 2.0;

What is the value and type of the expression z=n?

a. 8 int
b. 8 float
c. 8 double
d. 8 unsigned
11. Which of the following statements is true?
a. int expressions are always computed exactly; but float
expressions can
suffer round-off error
b. float expressions are always computed exactly; but int
expressions can
suffer round-off error
c. Both int and float expressions can suffer round-off error
d. Both int and float expressions will always be computed exactly
12. Given the following declarations:

int N;
float X;

what is the type of the expression X%N?

a. int
b. float
c. double
d. can''t use float with %
13. Choose the C statement which defines an enumeration type fuzzy
consisting of values false, maybe, and true. Defined so that maybe
is
greater in value than false but less than true.

a. enum fuzzy {false, maybe, true};
b. enum fuzzy {true, false, maybe};
c. enum fuzzy {false, maybe, true}
d. enum fuzzy {true, maybe, false};
14. Given the type definition below:

enum color {red, yellow, green, blue};

what is the value of the expression (int) blue?

a. 2
b. 3
c. 4
d. blue
15. Which of the following statements allocates space for a variable
of the
defined enum type?

a. enum color {red, yellow, blue} paint;
b. enum color {red, yellow, blue};
c. enum {red, yellow, blue} paint;
d. a and c
Answer questions 16 and 17 given the following values for the int
variables
X and Y

X=1100110000110011
Y=0000111100001010
16. What is the binary representation of X<<5?

a. 1000011001100000
b. 1000011001111111
c. 0000110011000000
d. 0000110011111111
17. What is the two''s complement of -Y (negative Y)?

a. 0000111100001010
b. 1111000011110101
c. 1111000011110110
d. 1100000000110001
18. If X is an int variable, what do we know about the value of X&X?

a. It is always equal to X.
b. It is always greater than 1.
c. It is always equal to zero.
d. It is always equal to 1.
19. A pointer variable contains:

a. an integer.
b. the address of another variable.
c. any data type.
d. a character string.
20. The term "dereferencing" means:

a. taking the address of another variable.
b. deleting a variable.
c. retrieving the value of a variable given its address.
d. making an assignment to a pointer variable.
21. Which of the statements below is true of the following
declaration:

int n=5, *p=&n;

a. p is a pointer initialized to point to n.
b. p is a pointer initialized to the value 5.
c. n and p are both pointer variables.
d. The declaration contains a syntax error
22. Call-by-reference is:

a. not available in C.
b. accomplished by declaring a formal parameter to be a pointer.
c. accomplished be using a de-referenced pointer as a parameter.
d. accomplished by putting an ampersand (&) in the formal parameter.
23. If you want a variable declared inside a function to retain its
previous
value when the block is re-entered, what type of storage class
should you
use?

a. auto
b. static
c. register
d. extern
24. The address operator & cannot be applied to which of the
following?

a. constants
b. expressions
c. variables of class register
d. All of the above
25. Write the output produced by the following code:

int x=5, y=6, *p=&x, *q=&y;
x=*q;
*p = *q + 2;
*q=x;
printf("%d %d %d %d\n", x, y, *p, *q);

a. 8 8 8 8
b. 5 6 5 6
c. 6 8 5 6
d. 6 8 6 8
"Daniel Antonson" <An********@comcast.net> wrote in message
news:mp********************@comcast.com...

What is the effect of the following code?

char Ch;

while ((Ch=getchar() ) != '';'')

putchar (Ch);

a. It will read and write characters until something other than a ;
is
read.

b. It will read characters up to and including the first semicolon,

and write characters up to but not including the first semicolon.

c. It will read and write characters up to but not including the
first
semicolon.

d. It will skip characters up to the first semicolon, then write
the

next character.





"Daniel Antonson" <An********@comcast.net> wrote in message
news:ep********************@comcast.com...

Fellow programmers,

As one of you pointed out, I''ve been taking 3 online courses (2 are done)
and have run into a time crunch. I started these courses in Oct04, but
between work (US Army in DC), caring for my wife (stroke in Dec03 due to
lupus complications) & daughter (4), and preparing for transfer/deployment
(my stepson,- 23, says he''ll care for them during my absence). I''ve had
little time for anything else.

I would greatly appreciate your assistance. Granted, it isn''t the proper
approach, but the time
remaining demands urgent solutions.

very respectfully,
Daniel



Yeah, I''d agree. This isn''t the proper approach.

No amount of hardship justifies us simply giving you the answers to your
homework. Plus, it won''t help you, and it won''t help anyone else, if you
pass a course simply by having the answers fed to you.

Please, folks, don''t give him the answers!

-Howard


Daniel:

After thinking about it a bit, my best guesses on the questions I
didn''t answer at first are:
12) d.
17) b.
22) b.

John

"Daniel Antonson" <An********@comcast.net> wrote in message
news:ep********************@comcast.com...

Fellow programmers,

As one of you pointed out, I''ve been taking 3 online courses (2 are
done)
and have run into a time crunch. I started these courses in Oct04,
but
between work (US Army in DC), caring for my wife (stroke in Dec03
due to
lupus complications) & daughter (4), and preparing for
transfer/deployment
(my stepson,- 23, says he''ll care for them during my absence). I''ve
had
little time for anything else.

I would greatly appreciate your assistance. Granted, it isn''t the
proper
approach, but the time
remaining demands urgent solutions.

very respectfully,
Daniel

1. Which of the following usually indicates that there is no more
input to
be read by a program?

a. ''\n''
b. ''\0''
c. END
d. EOF
2. What is the effect of the following code?
char Ch;
Ch = ''7'';
printf("%d\n", Ch);

a. It will cause an error
b. It will print out the computer''s internal code for the character
''7''
c. It will print out the character ''7''
d. It will print out the character whose internal code is 7
3. What is the effect of the following code?
char Ch;
while ((Ch=getchar() ) != '';'')
putchar (Ch);

a. It will read and write characters until something other than a ;
is read.
b. It will read characters up to and including the first semicolon,
and
write characters up to but not including the first semicolon.
c. It will read and write characters up to but not including the
first
semicolon.
d. It will skip characters up to the first semicolon, then write the
next
character.
4. It is necessary to use an int instead of a char for processing a
character:

a. whenever a computation is performed on the character.
b. whenever a test for EOF is made.
c. whenever the character is passed as a parameter to a function.
d. It is never necessary to use an int for character processing.
5. What characters are output by the following code:

char Ch=''/'';
while (Ch != ''d'')
{
putchar(Ch);
Ch = getchar();
}

given the following input? abcdefghi

a. abc
b. d
c. /abc
d. /efghi
6. What is the effect of the following code?

char Ch;
while ((Ch = getchar()) != ''\n'')
putchar('' '');

a. It reads and writes exactly one line with a blank after each
character.
b. It reads one line but outputs only blanks.
c. It reads a line and then outputs one blank.
d. It reads and writes one line with all blanks replaced by
newlines.
7. In general, when an int is combined with a long in an expression,
the
result is:

a. int
b. long
c. double
d. A syntax error
8. Given the following declarations:

int N;
char C;
float X;

what is the type of the expression C+N*X?

a. char
b. int
c. float
d. The expression contains a syntax error
9. Given the following declarations and initialization:

int i = 1;
int x = 2.0;

What is the value and type of the expression i/x?

a. .5 double
b. .5 int
c. 0.0 float
d. 0 int
10. Given the following declarations and initializations:

int n = 8;
int z = 2.0;

What is the value and type of the expression z=n?

a. 8 int
b. 8 float
c. 8 double
d. 8 unsigned
11. Which of the following statements is true?
a. int expressions are always computed exactly; but float
expressions can
suffer round-off error
b. float expressions are always computed exactly; but int
expressions can
suffer round-off error
c. Both int and float expressions can suffer round-off error
d. Both int and float expressions will always be computed exactly
12. Given the following declarations:

int N;
float X;

what is the type of the expression X%N?

a. int
b. float
c. double
d. can''t use float with %
13. Choose the C statement which defines an enumeration type fuzzy
consisting of values false, maybe, and true. Defined so that maybe
is
greater in value than false but less than true.

a. enum fuzzy {false, maybe, true};
b. enum fuzzy {true, false, maybe};
c. enum fuzzy {false, maybe, true}
d. enum fuzzy {true, maybe, false};
14. Given the type definition below:

enum color {red, yellow, green, blue};

what is the value of the expression (int) blue?

a. 2
b. 3
c. 4
d. blue
15. Which of the following statements allocates space for a variable
of the
defined enum type?

a. enum color {red, yellow, blue} paint;
b. enum color {red, yellow, blue};
c. enum {red, yellow, blue} paint;
d. a and c
Answer questions 16 and 17 given the following values for the int
variables
X and Y

X=1100110000110011
Y=0000111100001010
16. What is the binary representation of X<<5?

a. 1000011001100000
b. 1000011001111111
c. 0000110011000000
d. 0000110011111111
17. What is the two''s complement of -Y (negative Y)?

a. 0000111100001010
b. 1111000011110101
c. 1111000011110110
d. 1100000000110001
18. If X is an int variable, what do we know about the value of X&X?

a. It is always equal to X.
b. It is always greater than 1.
c. It is always equal to zero.
d. It is always equal to 1.
19. A pointer variable contains:

a. an integer.
b. the address of another variable.
c. any data type.
d. a character string.
20. The term "dereferencing" means:

a. taking the address of another variable.
b. deleting a variable.
c. retrieving the value of a variable given its address.
d. making an assignment to a pointer variable.
21. Which of the statements below is true of the following
declaration:

int n=5, *p=&n;

a. p is a pointer initialized to point to n.
b. p is a pointer initialized to the value 5.
c. n and p are both pointer variables.
d. The declaration contains a syntax error
22. Call-by-reference is:

a. not available in C.
b. accomplished by declaring a formal parameter to be a pointer.
c. accomplished be using a de-referenced pointer as a parameter.
d. accomplished by putting an ampersand (&) in the formal parameter.
23. If you want a variable declared inside a function to retain its
previous
value when the block is re-entered, what type of storage class
should you
use?

a. auto
b. static
c. register
d. extern
24. The address operator & cannot be applied to which of the
following?

a. constants
b. expressions
c. variables of class register
d. All of the above
25. Write the output produced by the following code:

int x=5, y=6, *p=&x, *q=&y;
x=*q;
*p = *q + 2;
*q=x;
printf("%d %d %d %d\n", x, y, *p, *q);

a. 8 8 8 8
b. 5 6 5 6
c. 6 8 5 6
d. 6 8 6 8
"Daniel Antonson" <An********@comcast.net> wrote in message
news:mp********************@comcast.com...

What is the effect of the following code?

char Ch;

while ((Ch=getchar() ) != '';'')

putchar (Ch);

a. It will read and write characters until something other than a ;
is
read.

b. It will read characters up to and including the first semicolon,

and write characters up to but not including the first semicolon.

c. It will read and write characters up to but not including the
first
semicolon.

d. It will skip characters up to the first semicolon, then write
the

next character.




这篇关于在时间轴上捏(悬疑:25Jul05)请求协助 - Q1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆