0% found this document useful (0 votes)
26 views4 pages

Lab 4

The document is a lab assignment submitted by a student to their instructor. It contains 4 tasks involving conditional statements in programming. The tasks include: 1) determining if a user-input number is even or odd, 2) finding the largest of 3 user-input integers, 3) determining the youngest of 3 user-input ages, and 4) performing math operations based on a user-input single character.

Uploaded by

Hafeez Ali
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)
26 views4 pages

Lab 4

The document is a lab assignment submitted by a student to their instructor. It contains 4 tasks involving conditional statements in programming. The tasks include: 1) determining if a user-input number is even or odd, 2) finding the largest of 3 user-input integers, 3) determining the youngest of 3 user-input ages, and 4) performing math operations based on a user-input single character.

Uploaded by

Hafeez Ali
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/ 4

NFC Institute of Engineering&Fertilizer

Research Faisalabad

Department of Electrical Engineering


Second Semester
Course Title:
Programming Fundamentals
Topic:
Lab Assignment
Submitted To:
Engr. Salman Arain
Submitted By:
Hafeez Ali
Roll.No:
18-ELE-43
Reg.#:
2018-UET-NFC-FD-ELECT-43
Lab.no.4
UNDERSTANDING OF CONDITIONAL STATEMENTS
Task#1
Write a program that takes the input number from the user and identify whether the
number is “even” or “odd” using conditional statements.
Input:

Output:

Task#2
Write a program that inputs three integers, then display largest number with proper
statement and if user enters the same numbers, it should display that the numbers are
equal. The program should be completed by using conditional statements only.
Input:
Output:

Task#3
If the user inputs the ages of Ali, Aslam and Aqeel, write a program to determine the
youngest of the three using conditional statements.
Input:

Output:
Task#4
Write a program that inputs single character and three integers and then do the
following,
 If user enters “s”, then perform addition of the three integers
 If user enters “p”, then perform multiplication of the three integers
 If user enters “a”, then perform average of the three integers
And if user enters any other character, it should display “Wrong Statement”
Input:

Output:

You might also like