0% found this document useful (0 votes)
14 views1 page

Lab 3: Selection Structures Objective Equipment Personal Computer With C Program Pre-Installed Questions

The document describes a lab assignment to write C programs that use floating point numbers. The first program prompts the user for 5 numbers, finds the minimum and maximum, computes the average, and prints the results. The second program takes x-y coordinates and displays the point and its quadrant.

Uploaded by

Akmal
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)
14 views1 page

Lab 3: Selection Structures Objective Equipment Personal Computer With C Program Pre-Installed Questions

The document describes a lab assignment to write C programs that use floating point numbers. The first program prompts the user for 5 numbers, finds the minimum and maximum, computes the average, and prints the results. The second program takes x-y coordinates and displays the point and its quadrant.

Uploaded by

Akmal
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/ 1

LAB 3: SELECTION STRUCTURES

Objective To write, compile and execute a program that uses floating point numbers.

Equipment Personal Computer with C Program Pre-Installed

Questions

1. Write, compile and execute a C program that will

a. Prompt the user for 5 floating numbers as shown below.

Enter number 1:
Enter number 2:
….
Enter Number 5:

b. Find the minimum and maximum values among these 5 numbers using if
statements

c. Compute the average from these numbers

d. Prints “You entered 5 numbers. The minimum is xx, the maximum is yy


and the average is zz”

Quadrant II Quadrant I

Quadrant III Quadrant IV

Fig. 3.1
2. Write a program that takes the x-y coordinates of a point in the Cartesian
coordinate system and displays the points entered while informing the user in
which quadrant (refer to Fig. 3.1) the point lies in.

You might also like