COMSATS University Islamabad
Park Road, Tarli Kalan, Islamabad
LAB REPORT # 6
CLASS
BEE-2D
SUBMITTED TO
Mam Sadaf Iqbal
COURSE
Introduction to Computer Programming
SUBMITTED BY
Muhammad Sharjeel (FA21-BEE-130)
LAB # 06: Functions, scope of Variables and Argument
passing
OBJECTIVES:
Understand the scope of variables when working with custom functions.
Provide more practice for custom functions.
In-Lab:
In-Lab Task 01:
Given the C program in the following code listing, complete the function sum _ of _ prod ( ) that
takes 4 inputs (floating point numbers) and returns their sum of products. Observe the outputs
generated by the program and explain what is happening with the Global variables and the
Formal Parameters.