You are on page 1of 1

COMSATS University (CUI), Islamabad

Department of Electrical and Computer Engineering

CSC-141 Introduction to Computer Programming


Spring-2023

Assignment No. 2:
DUE DATE : Tuesday, 4th April, 2023
Question 1
Write a program in C to display the multiplication table of a given integer using for
loop.
Input the number (Table to be calculated): 9
Expected Output:
9X1=9

• Write the same Program using While and then Do while loop structures.
• Make sure to write meaning full comments.

Question 2 (Topic: Functions in C)

Part a: Create a C program using user define functions to calculate the Area of
square and Area of a triangle.

Part b: Write a program in C using user define functions to check a given number is
even or odd.

In each part (a, b) of question NO.2, the user define function should be defined,
declared in the following four different ways. So there should be four different
programs for each part.

1. Using the function with no arguments and no return value


2. Using the function with no arguments and one return value
3. Using the function with arguments and no return value
4. Using the function with arguments and one return value

• Make sure to write meaning full comments and take care of syntax.

Submission Instructions:

Please submit hard copy of your solution on 4th April 2023.

Note:

Copied or plagiarized assignments will result in a zero


grade.

You might also like