Tech Study

250 C++ Program Examples & Solutions

INTRODUCTION :

Basic c++ programs

To include object-oriented Paradigm in C Language, C++ Programming Examples were introduced as a general-purpose programming language. Though the codes and basic syntax in both C Language and C++ programming Language are the same. Being a middle level programming language rendering C++ has the advantage of programming low-level and higher-level applications.

c++  programs Key Points and Features

  • C++ is a simple language. Programs can be broken down into logical units and parts. It also has rich library support and a variety of data types
  • C++ is not platform independent as programs created on Linux can not run on windows. But these programs are independent of machine
  • With C++ language we can build large-scale user applications as well as system programming.
  • It has a rich built-in data structure algorithms library, also 3rd party library for fast development
  • In C++ there is no additional processing overhead such as garbage collection, dynamic typing, etc, which makes its execution fast.
  • C++ Programming Language provides pointer support with which the user can directly manipulate the storage address. This helps in programming where the user needs to have good control over the storage of variables for basic c++ programs

In 1979, Danish computer scientist Bjarne Stroustrup developed C++ Programming Language . C++ was originally called ‘C with classes’.

Why use C++?

It is the most famous programming language in the world. It can be found in operating systems, GUIs and embedded systems. C++ gives a clear structure to the program because it is an object-oriented programming language. It also allows code to be used again which decreases the development cost. It is easy to learn  Basic c++ programs

New to coding world or want to learn more about coding , Here are some of the book we highly recommend you should read once in your lifetime
6 Best Coding Books for Beginners You Must Read in 2023

The best way to learn C++ programming language is by practicing C++ Programming Examples. All the following C++ Language programs on this webpage are tested and should work on all C++ compilers.

List of  C++ Programming Examples and Solutions →

 Basic C++ Language programs with examples

  1. C++ Program to Print “Hello, World!”.
  2. C++ Program to Add Two Integers.
  3. C++ Program to Swap Values of Two Variables.
  4. C++ Program to Multiply two Floating Point Numbers.
  5. C++ Program to perform all arithmetic operations.
  6. C++ Program to convert feet to meter.
  7. C++ Program to convert celcius to farenheit.
  8. C++ Program to convert farenheit to celcius.
  9. C++ Program to find the Size of data types.
  10. C++ Program to Print ASCII Value.
  11. C++ Program to Calculate Area of Circle.
  12. C++ Program to Calculate Area of Square.
  13. C++ Program to Calculate Area of Rectangle.
  14. C++ Program to convert days to years, weeks and days.

List of C++ language string programs

  1. Write C++ program to concatenate two strings
  2. Write C++ program to find string length
  3. Write C++ program to convert a string to Lower case
  4. Write C++ program to convert a string to Upper case
  5. Write C++ program to change string to upper case without strupr
  6. Write C++ program to change string to lower case without strlwr
  7. Write C++ program to reverse a string enter by user
  8. Write C++ program to count number of alphabets, digits and special characters in string
  9. Write C++ program to compare two strings using strcmp

List of all conditional programs in c++ language

  1. C++ Program to check whether an integer entered by the user is odd or even
  2. C++ Program to find the largest number among three number.
  3. C++ Program to Find the Largest Number using Conditional Operator.
  4. C++ Program to find the Largest among Three Variables using Nested if.
  5. C++ program to check leap year using conditional Operator.
  6. C++ program to check alphabets using conditional operator.
  7. C++ program to check number is positive, negative or zero.
  8. C++ program to check uppercase or lowercase alphabets.
  9. C++ program to check entered character vowel or consonant.
  10. C++ program to check whether a character is alphabet, digit or special character.
  11. C++ program to print day name of week.
  12. C++ program to accept two integers and check whether they are equal or not.
  13. C++ program to detrermine a candidate’s age is eligible for casting the vote or not.
  14. C++ program to find the eligibility of admission for an engineering course based on the criteria.
  15. C++ program to calculate the total marks, percentage and division of student.
  16. C++ program to enter month number and print number of days in month.
  17. C++ program to count total number of notes in entered amount.
  18. C++ program to check whether a triangle can be formed by the given value for the angles.

List of C++ Language Loop Programs with Examples

  1. Write C++ program to print alphabets from a to z
  2. Write C++ program to print ASCII values of all characters
  3. Write C++ program to print multiplication table of a given number
  4. Write C++ program to print all natural numbers in reverse order
  5. Write C++ program to print sum of digits enter by user
  6. Write C++ program to find sum of even numbers between 1 to n
  7. Write C++ program to find sum of odd numbers between 1 to n
  8. Write C++ program to swap first and last digit of a number
  9. Write C++ program to find the sum of first and last digit of any number
  10. Write C++ program to find first and last digit of any number
  11. Write C++ program to calculate product of digits of a number
  12. Write C++ program to reverse a number using while & for loop
  13. Write C++ program to calculate power using while & for loop
  14. Write C++ program to find factorial of any number
  15. Write C++ program to check whether a number is Armstrong number or not
  16. Write C++ program to find Armstrong numbers between 1 to n
  17. Write a C++ program to calculate compound Interest
  18. Write a C++ program to check a enter number is Prime number or not using while & for loop
  19. Write a C++ program to check whether a number is palindrome or not
  20. Write C++ program to print number in words
  21. Write C++ program to find HCF of two numbers
  22. Write C++ program to find LCM of two numbers

List of Switch case C++ Programming Examples

  1. Write C++ program to print number of days in a month using switch case
  2. Write C++ program to print day of week name using switch case
  3. Write C++ program to create calculator using switch Statement
  4. Write C++ program to check even or odd number using switch case
  5. Write C++ program to check vowel or consonant using switch case
  6. Write C++ program to print gender (Male/Female) program according to given M/F.
  7. Write C++ Program to find maximum number using switch case.

List of c++ language function and recursion programming exercises

  1. Write C++ program to check even or odd using functions
  2. Write C++ to check prime and armstrong numbers using function
  3. Write C++ program to find cube of a number using function
  4. Write C++ Program to convert binary number to decimal
  5. Write C++ Program to convert decimal number to binary using function
  6. Write C++ program to find Length of the String by passing String/Character
  7. Write C++ program to print all strong numbers between 2 numbers
  8. Write C++ program to find prime numbers in given range using functions
  9. Write C++ program to find diameter, circumference and area of circle using function
  10. Write C++ program to print perfect numbers between given interval using function
  11. Write C++ program to find power of a number using recursion
  12. Write C++ program to find sum of natural numbers in given range using recursion
  13. Write C++ program to print even or odd numbers in given range using recursion
  14. Write C++ program to find reverse of a number using recursion
  15. Write C++ program to find LCM of two numbers using recursion
  16. Write C++ program to find HCF of two numbers using recursion
  17. Write C++ program to print elements of array using recursion
  18. Write C++ program to find sum of array elements using recursion
  19. Write C++ program to generate nth fibonacci term using recursion
  20. Write C++ program to find factorial of a number using recursion
  21. Write C++ program to check palindrome number using recursion
  22. Write C++ program to find maximum and minimum elements in array using recursion

List of C++ language Pointer Exercise

  1. Write C++ program to swap two numbers using pointers
  2. Write C++ program to add two numbers using pointers
  3. Write C++ program to Sum of Array Elements using Pointers
  4. Write C++ program to find length of string using pointer
  5. Write C++ program to copy one string to another string using pointer
  6. Write C++ program to concatenate two strings using pointer
  7. Write C++ program to print the elements of the array in reverse order using a pointer

List of C++ language array programs with an examples

  1. Write a C++ program to print all negative elements in an array
  2. Write C++ program to count total number of negative elements in array
  3. Write C++ program to read and print elements of array
  4. Write C++ program to find sum of all elements of an array
  5. Write C++ program to count even and odd elements in an array
  6. Write C++ program to find maximum and minimum element in array
  7. Write C++ program to insert an element in array
  8. Write C++ program to print all unique element in an array
  9. Write C++ program to sort an array in ascending order
  10. Write C++ program to copy all elements of one array to another
  11. Write C++ program to count number of each element in an array
  12. Write C++ program to delete all duplicate elements from an array
  13. Write C++ program count total duplicate elements in an array
  14. Write C++ program to merge two sorted array
  15. Write C++ program to put even and odd elements of array in two separate array
  16. Write C++ program to find reverse of an array
  17. Write C++ program to left rotate an array
  18. Write C++ program to right rotate an array

List of C++ language matrix programs with an examples

  1. Write C++ Program to Add Two Matrices
  2. Write C++ Program to Multiply Two Matrices
  3. Write C++ Program to check whether two matrices are equal or not
  4. Write C++ Program to Find the Transpose of a given Matrix
  5. Write C++ Program to Find sum of each row and columns of a matrix
  6. Write C++ Program to Find the Frequency of Odd & Even Numbers in the given Matrix
  7. Write C++ Program C program to interchange diagonals of a matrix

Number pattern programs in c++ language


Star Pattern in c++ Programming language


All C++ Alphabet programs with examples

 

conclusion

In this article, we discuss C++ Programming Examples & Solutions for basic c++ programs. Hope this blog helps you understand the concept of basic c++ programs

TaggedC ExamplesC# Basic Exercises Practice SolutionC# programming example and solutionsC++ SolutionsCPP Exercises

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more