Assignment For BCSG 0002 - Computer Programming - Removed
Assignment For BCSG 0002 - Computer Programming - Removed
SET – C
ROLL NO. 21 – 30
Q. 1 Scenario: You are working on a library system. Implement a C code to calculate the late fee
for a borrowed book based on the number of days book is borrowed. Consider different fee
structures for different types of books.
Type of book Days Late Fees
7 No Late fees
A 8-10 Rs. 2 per day
More than 10 Rs. 5 per day
5 No Late fees
B 6-10 Rs. 5 per day
More than 10 Rs. 10 per day
Q. 2 Scenario: You are developing a scientific calculator program in C. Implement a C code that
calculates the real roots of a quadratic equation `ax 2 + bx + c = 0` based on user-provided
coefficients `a`, `b`, and `c`. Handle cases with complex roots as well.
Q. 3 Scenario: You are developing a program to find the Fibonacci sequence. The Fibonacci
sequence is a sequence of numbers where each number is the sum of the two previous
numbers. The first two numbers in the Fibonacci sequence are 0 and 1. Write a C program
to find the Fibonacci sequence up to a given number of terms.
Q. 4 Scenario: You are developing a program to find the A.P. series. An Arithmetic Progression
series is a series of number having the common difference between any two consecutive
terms of series. Write a C program to find the A.P. series and the sum of an A.P. series.
Q. 5 Scenario: You are to develop a User defined Program to find the Leap Year Finder program.
Write a C code to implement the program to run the code for user defined inputs for year
and continuation of program. (Use Do while for User Defined Program.)
Q. 6 Scenario: You want to develop a Strong Number Calculator. A Strong number is a number
whose sum of factorial of digits is equal to the original number. Write a C code to develop
the Calculator for a given input N.
Q. 7 Scenario: You are developing a program to find the least common multiple (LCM) of two
numbers. The least common multiple of two numbers is the smallest positive integer that is
a multiple of both numbers. Write a C program to find the least common multiple of two
numbers, given two positive integers.
Q. 8 Scenario: You are developing a calendar Calculator. Write a C code to convert the given
number of Days into Years, week and days, using arithmetic operations.
Q. 9 Scenario: You are developing a program to calculate the volume of a sphere. The volume
of a sphere can be calculated using the following formula:
Q. 10 Scenario: You are developing a program to find the greatest common divisor (GCD) of two
numbers. The greatest common divisor of two numbers is the largest positive integer that
divides both numbers. Write a C program to find the greatest common divisor of two
numbers, given two positive integers.