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

Cpe202 - Midterm Examination (LMS)

Uploaded by

luigsarahm
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)
12 views2 pages

Cpe202 - Midterm Examination (LMS)

Uploaded by

luigsarahm
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

CPE202 – PROGRAMMING LOGIC AND DESIGN (MIDTERM EXAMINATION)

NAME: __________________________ DATE: ________________

TEACHER: ________________________ SCORE: _____/50

ANSWER THE FOLLOWING QUESTIONS HONESTLY.

I. TRUE OR FALSE (10 points)

Write 'True' if the statement is correct; otherwise, write 'False.'

1. There are 34 keywords in C language.


2. Variables of type char are used to hold integer quantities.
3. Variables that are declared inside a function are called global variable.
4. C programming Language is not case sensitive.
5. After the creation of the C programming language, it did not become popular immediately.
6. All variables must be declared before they may be used.
7. Local variables are created by declaring them outside of any function.
8. Using pseudocode means listing all the steps for a program in a readable format.
9. &d is a line character used to move the cursor to the next line.
10. printf is a function used to display the argument list on the monitor.

II. FLOWCHART AND PSEUDOCODE (10 points)

Create a flowchart and write the corresponding pseudocode.

1. Given two numbers X and Y, draw a flowchart to determine the difference between X and Y. If X - Y is negative,
compute R = X + Y; If X - Y is zero, compute R = 2X + 2Y; and if X - Y is positive, compute R = X * Y. Print the values
of X, Y, and R.

III. DEBUGGING (15 points)

Search for errors and fix them. Take a screenshot of the corrected code along with the output. Each item contains five
errors, either syntax or logical.

1. 2.

3.
IV. PROGRAMMING (15 Points)

Create a program based on the following instructions. Take a screenshot of your code and its output. Submit your
program file along with this document file.

1. Given two numbers X and Y, create a program to determine the difference between X and Y. If X - Y is
negative, compute R = X + Y; If X - Y is zero, compute R = 2X + 2Y; and if X - Y is positive, compute R = X * Y.
Print the values of X, Y, and R.
2. Create a program that prompts the user to enter a number from 1 to 10 and then generates the
multiplication table for that number.
3. Create a program that prompts the user to enter a positive integer and then counts down from that number
to zero, displaying each number on a new line.

You might also like