| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2615 人关注过本帖
标题:公司给的几道C语言方面的题目
取消只看楼主 加入收藏
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
 问题点数:0 回复次数:15 
公司给的几道C语言方面的题目

QUESTION #1

The questions are based on the following scenario:

A causes B or C, but not both.

F occurs only if B occurs.

D occurs if B or C occurs.

E occurs only if C occurs.

J occurs only if E or F occurs.

D causes G, H, or both.

H occurs if E occurs.

G occurs if F occurs.

1. Answer the following questions. Watch the wording closely, and be careful about assumptions. Be sure to write down anything that may seem applicable:

a. If A occurs, which may occur?

b. If B occurs, which must occur?

c. If J occurs, which must have occurred?

d. Which may occur as a result of a cause not mentioned?

2. Write a program in C that utilizes the scenario logic to graphically (ASCII characters) depict the stated scenario. This program should take character(s) from the command line as input. Remember to write the most optimal code possible.

QUESTION #2

1. Write optimized C programs that will do the following:

a. Convert a base 16 number to its base 10 equivalent. Use 23DA as a test number.

b. Convert a base 8 number to its decimal equivalent. Use 7025 as a test number

c. How many integers from 1 to 1000 are not divisible by 8 or 12?

d. How many integers from 1 to 1000 are divisible by 6 or 8?

2. Explain why did you optimize your code this way.

QUESTION #3

1. Considering compacting memory while managing equal-sized blocks. Assume each block consists of a data field and a pointer field, and that we have marked every block currently in use. The blocks are currently located between memory locations a and b. We wish to relocate all active blocks so that they occupy contiguous memory starting at a. In relocating a block remember that the pointer field of any block pointing to the relocated block must be updated. Design an optimized C program for compacting the blocks.

QUESTION #4

1. Write a program in C to multiply two linear matrices. This program should take as input the dimensions of each matrix, as well as the components of each matrix. Remember to write the most optimal code possible. Use the following matrices as a test:

1 0

-2 3 0 6 1

5 4 3 8 -2

0 1

QUESTION #5

1. Assume that your CPU does not have multiply and divide units. You can not use function in C that will not use multiply, divide and modulo operators. Write the following programs:

a) multiply any given number by 7

b) divide any given number by 7

2. Make sure that you write the most optimized code, and give full description of any potential errors that can happen using your function.

搜索更多相关主题的帖子: C语言 
2007-07-02 23:19
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
不好意思,好象太小了,希望路过的高手帮忙看下..............
2007-07-02 23:21
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

郁闷啊,我英语也不好的啊!!
笔试的题目,兄弟门,帮个忙啊!!!!!!!!!!!!!!

2007-07-03 00:10
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

太感谢了................

2007-07-03 09:32
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
各位朋友一定要帮忙做下啊,实习单位发的题目,7月7号之前要交去的,拜托了..................(在线等待)
2007-07-03 10:12
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

大哥帮忙做下啊!!!!!!!!!!急啊!!!!!!!!!!!

2007-07-03 10:37
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

谢谢............

2007-07-03 11:15
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
各位朋友一定要帮忙做下啊,实习单位发的题目,7月7号之前要交去的,拜托了..................(在线等待)
2007-07-03 11:16
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
谢谢楼上的各位,但是能不能给出具体的东西啊!!!!!!!!!!!!!!!!!!!
2007-07-03 14:48
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
谢谢楼上的各位.......
问题4,问题5有人会吗??
帮帮忙啊!!!!!!!!!
2007-07-03 18:49
快速回复:公司给的几道C语言方面的题目
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018873 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved