CPP Programs
There is no learning without practicals. Here you can practice C++ (CPP) programs, from beginner’s level to expert’s level. You can think C++ practicals in two parts, first one is to develop your basic programming skills using decision controls, loops, functions, arrays and strings. In the second part you can build object oriented skills.
Warm up
- Write a CPP program to print HELLO on the screen
- Write a CPP program to calculate area of a circle
- Write a CPP program to calculate simple interest
- Write a CPP program to calculate average of three numbers
Decision Control
- Write a CPP program to check whether a given number is even or odd
- Write a CPP program to find greater between two numbers
- Write a CPP program to find greater between three numbers
- Write a CPP program to check whether a given year is a leap year or not
Loop
- Write a CPP program to calculate sum of first N natural numbers
- Write a CPP program to calculate factorial of a number
- Write a CPP program to print N terms of Fibonacci series
- Write a CPP program to check whether a given number is prime or not
Function
- Write a CPP function to calculate area of a circle
- Write a CPP function to calculate LCM of two numbers
- Write a CPP function to calculate HCF of two numbers
- Write a CPP function to find next prime number of a given number
Function Overloading
- Define two overloaded versions of function calculating area of circle and rectangle
- Define two overloaded versions of function calculating volume of sphere and cuboid
Classes and Objects
- CPP Program to define a class Time with HR,MIN, SEC as member variables and setTime, showTime, normalize as member functions
- CPP program to define a class Rectangle
Operator Overloading
- CPP program to overload + operator in Time class
- Overloading of subscript operator [ ] in C++
- Overloading of parenthesis ( ) operator
- C++ Program to overload > greater than operator in Time class
Inheritance
- Employee inherits Person example
- #1 Inheritance Example in C++ | Single public Inheritance | Hindi
- #2 private Inheritance Example in C++ | Hindi
File Handling
- CPP Program to copy data from one file to another Hindi
- Book Record Management Example
Data Structure in C++
- CPP program to implement ArrayADT part-1
- CPP program to implement ArrayADT part-2
- CPP program to implement ArrayADT part-3
- CPP Program to implement ArrayADT part 4
- CPP Program to implement LinkedListADT part-1
- CPP Program to implement LinkedListADT part-2
- CPP Program to implement LinkedListADT part-3
- CPP Program to implement LinkedListADT part-4
- CPP Program to implement LinkedListADT part-5
- CPP Program to implement Two Way Stack part-1 of 2
- CPP Program to implement Two Way Stack part-2 of 2