0% found this document useful (0 votes)
29 views2 pages

Ee 171 Test 2 2014

Uploaded by

Ismail Mtumwa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Ee 171 Test 2 2014

Uploaded by

Ismail Mtumwa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

University of Dar es Salaam College of Engineering and Technology (CoET)

Department of Electrical Engineering


EE 171: Introduction to Computers & Programming for Engineers
Test #2 Date: January 26, 2014.

Instructions to Candidates: 1. Time allowed: 45 Minutes. 2. Attempt all Questions. 3. Write legibly.
4. This is a closed book test. 5. All answers should be written within two pages of this sheet of paper
6. Use of Mobile Phones is strictly prohibited during the test. 7. Fill in your personal particulars clearly.

Surname First Name Initials Registration No. Degree Programme

2013-04-

No. Questions Answers Marks

In C Programming, the scanf() function is (i) integer(long signed) 2


accompanied by format specifier codes. Give the (ii) 2
real(double)
meaning of the following format specifier codes
1 (iii) integer(long unsigned) 2
for the function scanf().
(iv) binary 2
(i) %ld (ii) %lf (iii) %ul (iv) %b (v) %f
(v) float 2

(i) 2
post-increment
Give the meaning of the following arithmetic
operations used in C Programming:
(ii) pre-decrement 2
2
(i) x++ (ii) - -x (iii) z += 10
(iii) z=z+10 2
(iv) z% = 10 (v) z -= 10
(iv) z=z%10 2

(v) z=z-10 2

(i) and 2

Give the meaning of the following bitwise (ii) right shift 2


operations used in C Programming:
3. (iii) 2
exclusive or
(i) & (ii) >> (iii) ^ (iv) | (v) ~ (iv) or 2

(v) compliment 2

(i) 8 bits 2
In C programming, give the minimum storage
(ii) 32 bits 2
requirement in “bits” for the following data types.
4. (i) char (ii) long unsigned integer (iii) 64 bits 2
(iii) double (iv) long signed integer
(iv) 32 bits 2
(v) float
(v) 32 bits 2

1
No. Questions Answers Marks

Var1 and Var2 are of type int variables. The


variables are initiated as follow: Var1 = 0xADFE
and Var2 = 0x864B in hexadecimal number
system. What are the values of Var1 and Var2
after the following C programme slice is
5. 15
executed. Comment on the results.

Var1 = Var1 ^ Var2;


Var2 = Var1 ^ Var2;
Var1 = Var1 ^ Var2;

(i) security 2
(ii) command interpretation 2
List down the main functions of an Operating
6. (iii) process management 2
System.
(iv) file management 2
(v) memory management 2
In C Programming, give the logical operators for (i) == 2
the following operations:
(i) Logical EQUAL to (ii) && 2
7. (ii) Logical AND (iii) != 2
(iii) Logical NOT EQUAL to
(iv) ! 2
(iv) REVERSE logical value
(v) Logical OR (v) II 2

global variables are more visible than loc


Based on visibility and accessibility, differentiate
8. between local variables and global variables in a al var. bt local variables are more a more 5
C programme. accessible than global variables

(i) is a statement th at contain no element 4


Define the following terms as applied to C
programming: is a statement that performs simple ope
(ii) 2
9. operatons
(i) Null statement
(ii) Simple statement is a statement that performs complex o
(iii) Compound statement (iii) 4
peration contain simple, null

(i) microsoft excel 2


Give one example of the following types of
Application Software Packages. (ii) microsoft word 2
(i) Spreadsheet Package
10. (ii) Word Processing Package (iii) 2
Spreadshits
(iii) Database Package
(iv) Engineering Graphical Design Package (iv) CAD(computer aided design 2
(v) Engineering Simulation Package
(v) MATLAB 2

You might also like