Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Computer Programming

Assignment No.01
OBJECTIVES
To test the knowledge of the following topics, covered so far;
the activity of programming
the architecture of computers
using your compiler
recognizing syntax and logic errors
writing algorithms in plain English
integer and floating-point numbers
writing arithmetic expressions in C
reading user input and displaying program output
changing the values of variables through assignment
writing simple programs that read numbers and text, process the input and display
the results
Q. 2: !at "i" #ou "o to $in" mat!.!% !"rite steps to locate math#h$
The program that you will be running to write computer programs is your text editor,
which is often part of an integrated compiler environment# %ou have already worked in
computer lab for total & hours !' labs$ and you have learned how to start the editor#
Compi&ing an" running programs $rom 'it!in #our "e(e&opment en(ironment
(re)uently in these labs you have compiled various programs# *elow is a copy of a C
program that displays a drawing# Copy and paste it into your compiler+s editor, and from
there save it as art#cpp#
,, -rogram to .isplay an +art+ drawing
/include 0iostream#h1
/include 0conio#h1
void main!$
2
clrscr!$;
cout003 4 4 3;
cout003 4 4 4 4 3;
cout003 4 4 4 4 3;
cout003 4 4 4 4 3;
cout003 4 4 4 4 3;
-age 5 of 6
cout003 4 4 4 4 3;
cout003 4 4 3;
getch!$;
7
8nce you have typed in !or, in this case, pasted in$ a program, you need to compile it to
create an executable file# (ind out the steps for your computer system, then go ahead and
compile art#cpp to an executable file#
-age 6 of 6

You might also like