0% found this document useful (0 votes)
55 views42 pages

II bcom-LABPROGRAMS

This document lists 50 practical programming problems in C++ that involve concepts like classes, functions, operators, inheritance, polymorphism, and more. The problems cover a wide range of fundamental programming tasks like number operations, string manipulation, arrays, searching, sorting, file handling and more.

Uploaded by

ecommercejvs
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
55 views42 pages

II bcom-LABPROGRAMS

This document lists 50 practical programming problems in C++ that involve concepts like classes, functions, operators, inheritance, polymorphism, and more. The problems cover a wide range of fundamental programming tasks like number operations, string manipulation, arrays, searching, sorting, file handling and more.

Uploaded by

ecommercejvs
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 42

II bcom -C

PRACTICAL PROGRAMS

1. Write a C++ program to reverse a given number.

2. Write a C++ program to add two numbers using class.


3. Write a C++ program to check whether a given number is prime.
4. Write a C++ program to demonstrate the usage of scope resolution operator.
5. Write a C++ program to check whether a given year is leap year or not.
6. Write a C++ program to add two numbers using functions.

7.Write a C++ program to accept and display the details of a student using class.
8.Write a C++ program to accept and display the details of an employee using a class

Try by yourself

9. Write a C++ program to count the number of words and characters in a given text.
10.Write a C++ program to compare two strings using string functions.

11.Write a C++ program to find the GCD of two numbers.


12.Write a C++ program to calculate the area of rectangle, square using function overloading
13. Write a C++ program to add two numbers using pointers.

14. Write a C++ program to find the factorial of a given number.


15. Write a C++ program to search for an element using binary search.
16. Write a C++ program to sort an array in ascending order.
17. Write a C++ program to find the factorial of a given number using recursion.

18. Write a C++ program to check whether a given number is even or odd.
19. Write a C++ program to demonstrate the usage of Inline function.

20. Write a C++ program to demonstrate parameter passing mechanism using pass by value method.
21. Write a C++ program to demonstrate parameter passing mechanism using pass by address method.
22.Write a C++ program to demonstrate the usage of a constructor and destructor in a class.

23. Write a C++ program to demonstrate simple inheritance.


24.Write a C++ program to calculate volume of cube, cylinder and rectangle using function overloading

Try urself(DIY)
25. Write a C++ program to demonstrate the usage of friend function in a class.
26.. Write a C++ program to demonstrate the usage of endl and setw manipulators.

27. Write a C++ program to display employee information using multiple inheritance.
28. Write a C++ program to demonstrate multilevel inheritance.
29. Write a C++ program to create a file.

30. Write a C++ program to check whether a given number is a palindrome or not.
31. Write a C++ program to generate the Fibonacci series using while loop.

32. Write a C++ program to overload + operator to add two complex numbers.
33. Write a C++ program to search for a given element in an array using linear search.

34. Write a C++ program to read a text file.

use Class program


36. Write a C++ program to create a simple class named Account and write methods to deposit and
withdraw amount from the account.

Same as program 24
37. Write a C++ program to demonstrate dynamic memory allocation in c++.
38. Write a C++ program to demonstrate polymorphism by calculating area of rectangle and triangle
using a shape class.

Try by urself ( function overloading)


39. Write a C++ program using Switch case to add, subtract, multiply and divide two numbers.

40. Write a C++ program using class to implement basic operations on a stack using arrays.
41. Write a C++ program to display the sizes of various data types in c++ language.

42. Write a C++ program to accept and display employee details using structures.
43. Write a C++ program to find the length of a given string using string functions.

44. Write a C++ program to print the ASCII value of a user entered character.

45. Write a C++ program to add two dimensional matrices.


46. Write a C++ program to overload + (plus) operator to perform concatenation of two strings.
47. Write a C++ program to find the sum of elements in a given array.
48. Write a C++ program to find the largest of 3 numbers.
49. Write a C++ program to demonstrate exception handling by dividing a number with zero.

Use class program


50. Write a C++ program to convert a binary number to a decimal number

You might also like