Harare Polytechnic
NC Computer Systems
Electrical Engineering
Due Date: 17 February 2025
Theory Assignment 1
Question 1
Define the following terms:
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
Programming
High level Language
Low Level Language
Compiler
Interpreter
Loader
Variable
Editor
Debugger
Declaration
(20 Marks)
Question 2
a.
b.
c.
d.
I.
II.
III.
IV.
V.
VI.
VII.
VIII.
State 3 rules of naming a variable in C programming
Define the term identifiers
State 4 reserved names in C programming
Explain the function of the following:
\n
\t
\\
;
“
{
}
>=
(6 Marks)
(2 Marks)
(4 Marks)
(8 Marks)
Question 3
#include<stdio.h>
int main() {
double a,b,c;
printf("Please enter three different numbers:");
scanf("%lf%lf%lf",&a,&b,&c);
if(a>=b && a>=c)
printf("%.2lf is the largest number.", a);
pg. 1
NC Computer Systems – Assignment 1
C Programming 2025
if(b>=a && b>=c)
printf("%.2lf is the largest number.", b);
if(c>=a&&c>=b)
printf("%.2lf is the largest number.”, c);
return 0;
}
a. Write the algorithm for the above program
b. Comment each instruction for the program above
c. Draw the flow chart for the above program
(20 Marks)
(20 Marks)
(20 Marks)
……………………………..a/n…………………………………..
pg. 2
NC Computer Systems – Assignment 1
C Programming 2025