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

Assignment-I

The document outlines an assignment for Jadavpur University for the Computer Programming and Numerical Methods course for the 2024-25 odd semester. It includes a series of programming tasks in C, such as swapping values, calculating areas and perimeters, determining odd/even numbers, and handling basic salary calculations. Additionally, there are optional tasks related to currency denominations and student marks aggregation.

Uploaded by

roleri2503
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Assignment-I

The document outlines an assignment for Jadavpur University for the Computer Programming and Numerical Methods course for the 2024-25 odd semester. It includes a series of programming tasks in C, such as swapping values, calculating areas and perimeters, determining odd/even numbers, and handling basic salary calculations. Additionally, there are optional tasks related to currency denominations and student marks aggregation.

Uploaded by

roleri2503
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Jadavpur University

Session 2024-25, Odd Semester


Computer Programming and Numerical Methods

Assignment – I

1. Write a C program that reads two values from the keyboard, swaps their values and prints out the result.

2. The length and breadth of a rectangle and radius of a circle are input through the keyboard. Write a
program to calculate the area and perimeter of the rectangle, and the area and circumference of the
circle.

3. If a three-digit integer is input through the keyboard, write a program to calculate the sum of its digits.
(Hint: Use the modulo operator ‘%’)

4. An integer is entered as an input through the keyboard. Write a program to find out whether it is an odd
number or an even number.

5. Input two integer numbers and divide the larger number by the smaller one. Then display the result using
printf() function as a fractional number first and then as a real valued number. (Example: 9 divided by 5
shall yield “ 4/5” and “1.8” respectively. )

6. Write a C program to find the maximum and minimum of three numbers.

7. Accept three integer numbers and find their average. Next display which numbers are below and above
the average value.

8. Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program to convert
this temperature into Centigrade degrees.

9. Write a C program which accepts basic salary as input and prints the gross salary, which is sum of the
basic, dearness allowance (60% of basic salary), and house rent allowance (15% of basic salary).

10. A cashier has currency notes of denominations 10, 50 and 100. Write a C program which accepts an
amount to be withdrawn, and prints the total number of currency notes of each denomination the cashier
will have to give to the withdrawer. [OPTIONAL]

11. If the marks obtained by a student in five different subjects are input through the keyboard, find out the
aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that
can be obtained by a student in each subject is 100. Input error should be checked. [OPTIONAL]

12. The length and breadth of a rectangle are input through the keyboard. Write a programme to determine
(i) radius of a circle and ratio of perimeters of the rectangle and the circle if the areas of the rectangle
and the circle are equal (ii) radius of the circle and the ratio of the areas of the rectangle and the circle if
the perimeters of the rectangle and the circle are equal. [OPTIONAL]

You might also like