0% found this document useful (0 votes)
27 views5 pages

Second Semester Department of Electrical Engineering

The document describes 5 tasks for a lab assignment on functions for a Programming Fundamentals course. The tasks involve: 1) Developing a function to calculate student marks average and percentage from 3 subjects. 2) Writing a function to return the smallest of 3 floating point numbers. 3) Writing a function to reverse the digits of an integer. 4) Writing a function to return the square of an integer. 5) Writing a function to display a series of numbers squared from 1 to the number of terms given by the user. The document provides the task descriptions and placeholders for input and output but does not include any code solutions.

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 DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views5 pages

Second Semester Department of Electrical Engineering

The document describes 5 tasks for a lab assignment on functions for a Programming Fundamentals course. The tasks involve: 1) Developing a function to calculate student marks average and percentage from 3 subjects. 2) Writing a function to return the smallest of 3 floating point numbers. 3) Writing a function to reverse the digits of an integer. 4) Writing a function to return the square of an integer. 5) Writing a function to display a series of numbers squared from 1 to the number of terms given by the user. The document provides the task descriptions and placeholders for input and output but does not include any code solutions.

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 DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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