You are on page 1of 5

NFC Institute of Engineering&Fertilizer

Research Faisalabad

Department of Electrical Engineering


Second Semester
Course Title:
Programming Fundamentals
Topic:
Lab Assignments
Submitted To:
Engr. Salman Arain
Submitted By:
Hafeez Ali
Roll.No:
18-ELE-43
Reg.#:
2018-UET-NFC-FD-ELECT-43
Lab.No.8
FUNCTIONS-A DEEPER LOOK
Task#1
Develop a function that receives marks obtained by a student in three subjects and
return average and percentage of the marks called from the main function. The final
output should print the result of the student.
Input:

Output:
Task#2
Write a function that returns the smallest of three floating point numbers.
Input:

Output:
Task#3
Write a function that takes an integer values and returns the numbers with its digits
reversed. For example, given the number 7631, the function should return 1367. Make
a generalized program.
Input:

Output:

Task#4
Write a function that returns the square of an integer.
Input:
Output:

Task#5
Write a function to display this series (1,4,9,16,25,…) and so on, where number of
terms is given by the user.
Input:

Output:

You might also like