Practical File
Object Oriented Programming Using C++
Course Code: ES203
Submitted to
Amity University Noida, Uttar Pradesh
In partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology
In
Computer Science and Engineering
By
Bismay Mukherjee (A2305224142)
Under the Guidance of
Prof. (Mr.) Nitin Kumar Goud
Assistant Professor
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
AMITY SCHOOL OF ENGINEERING AND TECHNOLOGY
AMITY UNIVERSITY NOIDA, UTTAR PRADESH
Batch: 2024-2028
INDEX
S.No Name of Program Date Teacher’s
Signature
1. (a) Write a C program to add two numbers.
(b) Write a C program to add three numbers.
2. (a) Write a C program to find area of circle.
(b) Write a C program to calculate simple interest.
3. Write a C program to print a block F using hash (#), where the F has a
height of six characters and width of five and four characters.
4. Write a C program that accepts two item’s weight (floating points' values)
and number of purchase (floating points' values) and calculate the average
value of the items.
5. (a) Write a C program to swap two variables using a third variable.
(b) Write a C program to swap two variables without using a third
variable.
6. (a) Write a C program to convert a given integer (in seconds) to hours,
minutes, and seconds.
(b) Write a C program to convert specified days into years, weeks, and
days.
7. Write a program to find the area of triangle.
8. Write a C program to check whether a number is even or odd.
9. Write a C program to check whether a given year is Leap year or not.
10. (a) Write a C program to check whether a triangle is Equilateral, scalene,
or isosceles.
(b) Write a C program to check whether a triangle is right angles, obtuse,
acute triangle.
11. Write a C program to covert temperature from Fahrenheit to Celsius and
Celsius to Fahrenheit (User must provide the choice of type of
temperature).
12. (a) Write a C program to check whether a character is an alphabet or a
digit.
(b) Write a C program a program to check whether an alphabet is a vowel
or consonant.
13. (a) Write a C program to find smallest of two numbers.
(b) Write a C program to find largest of three numbers.
14. Write a program in C to implement Simple Calculator.
15. WAP to calculate the root of a Quadratic Equation.
16. WAP to accept a coordinate point in a XY coordinate system and
determine in which quadrant the coordinate point lies.
17. Write a program to find gross salary of employee if DA is 40% of basic
Salary and HRA is 20% of basic salary. Basic salary will be entered as
input by keyboard.
18. Write a program in C to calculate and print the Electricity bill of a given
customer. The customer id and unit consumed by the user should be taken
from the keyboard and display the total amount to pay to the customer.
19. A library charges a fine for every book returned late. For first 5 days the
fine is 50 paisa, for 6-10 days, fine is one rupee and above 10 days, fine is
5 rupees. If you return the book after 30 days your membership will be
cancelled. Write a program to accept the number of days the member is
late to return the book and display the fine or appropriate message.
20. Write a program to find the factorial of any number.
21. Write a program to print Fibonacci sequence
0 1 1 2 3 5 8 13…… N terms and prints the sum of sequence.
22. Write a program in C to accept an integer numbers and find sum of digits.
23. Write a program in C to accept an integer numbers and find reverse of this
number and check this number for palindrome.
24. Write a program in C to accept an integer numbers and to check a number
is Armstrong or not.
25. Write a program in C to accept an integer numbers and to check a number
is Perfect or not.
26. Write a program to find the sum of following series:
S = 2+4+6+8+……………N terms.
27. Write a program to check a number whether it is prime number or not.
28. Write a program to find the sum of following series:
1 – 1/2 + 1/3 – 1/4 + 1/5 - …… up to n terms.
29. Write a program to find the sum of following series:
1! + 2! + 3! + 4! + ….. + n!
30. Write a program to find the sum of following series:
S = -13 + 33 - 53 + 73 – 93 + 113 - ……..N terms.
31. Write a program to find the sum of following series:
S = 1/1! + 2/2! + 3/3! + ………….. 7 terms.
32. Write a program to convert binary number to decimal number.
33. Write a program to find the sum of following series:
S = 14 + 34 + 54 + 74 + …………….. 100 terms
34. Write a program in C to print the following pattern:
* * *
* * *
* * *
35. Write a program in C to print the following pattern:
1 2 3
1 2 3
1 2 3
36. Write a program in C to print the following pattern:
1 1 1
2 2 2
3 3 3
37. Write a program in C to print the following pattern:
3 2 1
3 2 1
3 2 1
38. Write a program in C to print the following pattern:
3 3 3
2 2 2
1 1 1
39. Write a program in C to print the following pattern:
*
**
***
40. Write a program in C to print the following pattern:
1
12
123
41. Write a program in C to print the following pattern:
1
22
333
42. Write a program in C to print the following pattern:
3
32
321
43. Write a program in C to print the following pattern:
3
22
111
44. Write a program in C to print the following pattern:
*
***
*****
*******
45. Write a program in C to print the following pattern:
1
121
12321
1234321
46. Write a program in C to print the following pattern:
5
545
54345
5432345
543212321
47. Write a program in C to print the following pattern:
1
01
101
0101
10101
48. Write a program to print all prime numbers <= a given number.
49. Write a program to convert Decimal no to Binary No.
50. Write a program to find product, sum, average, max and min from a list of
n numbers.
51. Write a program in C to display the index of smallest and largest element
in 10 integers.
52. Write a program in C to display the index of smallest and largest element
in 3 X 4 matrix of integers.
53. Write a program in C that accepts N*N matrix as input and print transpose
of this matrix.
54. Write a program to accept two matrices of some order. (Order must be
given by user) find out the sum of these matrices and print the sum of
matrices.
55. Write a program to find out the product/Multiplication of two matrices
and print the product matrix. (order of matrices must be given by user).
56. Write a program to accept two matrices of some order. (Order must be
given by user) find out the subtraction of these matrices and print the sum
of matrices.
57. Write a C Program to implement Simple Calculator (Addition,
Subtraction, Multiplication, Division) using the concept of function.
58. Write a C Program to swap two values using function.
59. Write a C Program to Calculate the factorial of a number using function.
60. Write a C Program to Calculate the factorial of a number using recursion.
61. Write a C program to check whether a number is even or odd using
functions.
62. Write a C program to check whether a number is Prime, Armstrong or
perfect number using functions.
63. Write a C program to find all prime numbers between given interval using
functions.
64. Write a C program to print all strong numbers between given interval
using functions.
65. Write a C program to find power of any number using recursion.
66. Declare a structure name student containing members name, roll_no,
marks. Create an array of 30 such students. Write a program to read and
display the contents of array.
67. Write a simple database program in C which stores personal details of 100
persons such as Name, Date of Birth, Address, Phone number etc.
68. Write a program in ‘C’ that compares two given dates. To store a date, use
a structure that contains three members namely day, month, and year. If
the dates are equal, then display message as “equal” otherwise “Unequal”.
69. Write a program which reads your name from the keyboard and outputs a
list of ASCII codes, which represent your name.
70. Write a program which will read a text and count all occurrences of all
characters which are part of text.
71. Write a program which will read a text and count all occurrences of a
particular word.
72. Write a program which reads a string from the keyboard and determines
whether the string is a palindrome (Ignore Capitalization).
73. Write macro definition with arguments for calculation of simple interest
and amount. Store these macro definitions in a file called ‘Interest.h”.
Include this file in your program and use the macro definition for
calculating simple interest and amount.
74. Write a program to copy the contents of one file to another file.
75. Write a program which will store ten integers to one file and squares of
these numbers to another file.
76. Write a program which will store ten integers to one file and stores the
odd and even numbers to respective files.
77. Write a program to compare two given strings.