0% found this document useful (0 votes)
8 views

Assignment 5

The document outlines a computer lab assignment that includes 5 programming problems. Students must complete all programs during the next lab class, submit their codes as a PDF before the following day's lab, and include their name and other details. Late submissions will be penalized.

Uploaded by

Deep Saha
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)
8 views

Assignment 5

The document outlines a computer lab assignment that includes 5 programming problems. Students must complete all programs during the next lab class, submit their codes as a PDF before the following day's lab, and include their name and other details. Late submissions will be penalized.

Uploaded by

Deep Saha
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/ 1

Computer Lab (CS 1171)

Assignment: 5

• Work out all programs and report the outputs during the lab class of 06-Jan-2023.
• If the assignment sheet is not complete, do the rest as homework.
• Put all your codes in a single pdf to upload in the Google Classroom before the
next day’s lab. Write your name, department, enrollment number, group number
on a top sheet. LATE SUBMISSION WILL BE PENALIZED.

1. Write suitable function and corresponding C program to swap values of two


integer variables with (a) using a temporary variable, (b) without using a
temporary variable.
(The two integers have to be taken as input from the user in the main () and passed
as parameter to the function.)

2. Write a C function to compute the GCD of two integers and return the result to
the main ().
(The two integers have to be taken as input from the user in the main () and passed
as parameter to the function.)

3. Write a recursive C function to compute factorial of an integer N that has to be


taken as input from the user in the main () and passed as parameter to the
function.

4. Write a C function finding out the factors for a natural number N and print them
sequentially. Here, N has to be taken as the input in the main () and passed as
parameter to the function.

5. Write C functions to print the following patterns for n number of rows, here n
is an input taken from keyboard and passed as a parameter to the functions.
(Use loops and ASCII codes where ever needed.)

You might also like