[go: up one dir, main page]

0% found this document useful (0 votes)
27 views2 pages

PGDCA C&C++ LAB ASSIGNMENT QUESTION

The document outlines a lab assignment for a PGDCA course focused on programming using C and C++. It lists 38 practical programming questions that cover various topics such as interest calculation, temperature conversion, loops, arrays, classes, operator overloading, inheritance, and file handling. The submission deadline for the assignment is set for January 10, 2025.

Uploaded by

dewangank510
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)
27 views2 pages

PGDCA C&C++ LAB ASSIGNMENT QUESTION

The document outlines a lab assignment for a PGDCA course focused on programming using C and C++. It lists 38 practical programming questions that cover various topics such as interest calculation, temperature conversion, loops, arrays, classes, operator overloading, inheritance, and file handling. The submission deadline for the assignment is set for January 10, 2025.

Uploaded by

dewangank510
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/ 2

PGDCA

LAB ASSIGNMENT
Subject - Programming using C & C++
List of The Practical Questions (Lab-II)
Submission Deadline : 10-01-2025

1. Write a program to find simple interest and compound interest.


2. Write a program to convert temperature from Fahrenheit to Celsius.
3. Write a program to generate a multiplication table of given number using for loop.
4. Write a program to find factorial of given number using a do-while loop.
5. Write a program to find Fibonacci series up to nth terms.
6. Write a program to find whether inserted year is leap year or not.
7. Write a program to find whether given number is prime or not.
8. Write a program to input three numbers and find the largest using relational and logical operators.
9. Develop a program to input marks and print the grade based on the following conditions:
• Marks >= 90: Grade A
• Marks >= 75: Grade B
• Marks >= 50: Grade C
• Marks < 50: Fail

10. Create a menu-driven program using the switch statement to perform basic arithmetic operations
(Addition, Subtraction, Multiplication, and Division).
11. Write a program to input a day number (1-7) and print the corresponding day of the week using the
switch statement.
12. Create a single program to perform following tasks using if. Else, loop and single dimension
integer array:
a) Sort the elements.
b) Find greater number and average.
13. Create a single program to perform following tasks using if, Else, loop and double dimension
integer array of size 3x3:
a) Addition of two matrix.
b) Subtraction of two matrix.
c) Multiplication of two matrix.
14. Write a program of swapping two numbers and demonstrates call by value and call by reference.
15. Create a program to return the largest of three numbers using return by reference.
16. Write a program to use an inline function for calculating the area of a circle and a rectangle.
17. Develop a program to calculate the perimeter of a rectangle, ensuring the dimensions remain
constant in the function.
18. Write overloaded functions to calculate the area of a circle, rectangle, and triangle.
19. Develop a program to create a class Rectangle with data members for length and width, and
member functions to calculate and display the area and perimeter.
20. Write a program to store and display details of 5 employees (ID, name, salary) using an array
of objects.
21. Write a program where a friend function calculates the average of marks of a student, accessing
private members of a Student class.
22. Write a program to create a class Circle with a parameterized constructor to initialize the radius
and calculate the area.
23. Develop a program to copy the details of a student (roll number, name, marks) from one object
to another using a copy constructor.
24. Write a program to count the number of objects created and destroyed using constructors and
destructors.
25. Write a program to overload the unary ++ and -- operator to increment and decrement the value
of a private data member.
26. Write a program to overload the + operator to add two complex numbers using a class Complex.
27. Write a program to overload the * operator to multiply two matrices using a class Matrix.
28. Create a class String and overload the + operator to concatenate two strings.
29. Develop a program to create a class Distance that converts a float value representing kilometers
into meters and centimeters.
30. Develop a program to convert objects of a Fahrenheit class to a Celsius class using operator
overloading.
31. Write a program to demonstrate multilevel inheritance with a base class Shape (basic properties),
derived class Rectangle (length and width), and further derived class Cuboid (height).
32. Create a program to handle data from two base classes Person (personal information) and
Employee (job details) using a derived class Manager.
33. Write a program to demonstrate hierarchical inheritance where a base class Animal has derived
classes Dog, Cat, and Bird, each with specific methods.
34. Write a program to create an abstract class Shape with a pure virtual function calculateArea() and
derived classes Circle and Rectangle that implement the function.
35. Write a program to demonstrate the use of a pointer to an object by creating a class Student with
data members for roll number and name. Use a pointer to access and modify object data.
36. Create a program to use the this pointer to return the current object from member functions in a
ChainedFunction class that supports method chaining.
37. Write a program to open a file in read mode and display its contents line by line until the end of
the file is reached.
38. Write a program to count the number of words, characters, and lines in a file.

You might also like