C++ Programs

This page includes the most basic and advanced CPP or C++ programs that includes numbers, strings, alphabets, and star pattern examples.

C++ Programs on Numbers

The list of simple and basic C++ programs on numbers.

  1. C++ program to print Hello World
  2. C++ program to Add Two Numbers
  3. C++ program to Calculate Simple Interest
  4. C++ program to Check Number is Divisible by 5 And 11
  5. C++ program to Count Total Notes in an Amount
  6. C++ program to find Largest of Two Numbers
  7. C++ program to find Largest of Three Numbers
  8. C++ Program to find Last Digit of a Number
  9. C++ Program to Calculate LCM of Two Numbers
  10. C++ Program to Check Leap Year
  11. C++ Program to Check Palindrome Number
  12. C++ Program to Check Perfect Number
  13. C++ Program to find Product of Digits in a Number
  14. C++ Program to Calculate Profit or Loss
  15. C++ Program to find Prime Factors of a Number
  16. C++ Program to Print 1 to 100
  17. C++ Program to Print Alphabets between A and Z
  18. C++ Program to Print alphabets from a to z
  19. C++ program to Print First 10 Even Natural Numbers
  20. C++ program to Print Even Numbers
  21. C++ program to Print Multiplication Table
  22. C++ program to Print First 10 Natural Numbers
  23. C++ program to Print First 10 Natural Numbers in Reverse
  24. C++ program to Print N Natural Numbers
  25. C++ program to Print Natural Numbers in Reverse
  26. C++ program to Print First 10 Odd Natural Numbers
  27. C++ program to Print Odd Numbers
  28. C++ program to Reverse a Number
  29. C++ program to find Square Root of a Number
  30. C++ program to find Square of a Number
  31. C++ program to Calculate Standard Deviation
  32. C++ program to check Strong Number
  33. C++ program to find Student Grade
  34. C++ program to Calculate Student Marks
  35. C++ program to find Sum of Digits in a Number
  36. C++ program to find Sum of Even Numbers
  37. C++ program to find Sum of Even and Odd
  38. C++ program to find Sum of First and Last Digit of a Number
  39. C++ program to find Sum of Natural Numbers from 1 to N
  40. C++ program to find Sum of Odd Numbers
  41. C++ program to find Find Sum of Series 1²+2²+3²+n²
  42. C++ Program to find Sum of Series 1³+2³+3³+n³
  43. C++ program to Swap Two Numbers
  44. C++ program to Swap First and Last Digit in a Number

C++ Character Programs

  1. find ASCII Values of all Characters
  2. Sum of ASCII values in a Character Array

C++ String Programs

  1. C++ program to Convert String to Lowercase
  2. C++ program to Convert String to Uppercase
  3. Maximum Occurring Character in a String
  4. Find String Length
  5. Sum of ASCII values in a String
  6. Toggle Character Cases in a String

C++ Programs on Arrays & Matrix

  1. Add Two Arrays
  2. Add Two Matrixes
  3. Arithmetic Operations on Array
  4. Arithmetic Operations on Matrix
  5. Check two Matrixes are Equal
  6. Determinant of a Matrix
  7. Identity Matrix
  8. Interchange Matrix Diagonals
  9. Lower Triangle of a Matrix
  10. Multiply Two Arrays
  11. Multiply two Matrixes
  12. Scalar Matrix Multiplication
  13. Sparse Matrix
  14. Subtract two Matrixes
  15. Sum of Opposite Diagonal of a Matrix
  16. Sum of Matrix Diagonal
  17. Sum of Matrix Row and Column
  18. Symmetric Matrix
  19. Transpose a Matrix
  20. Upper Triangle of a Matrix

Conversion Programs

  1. Convert Days to years and Weeks
  2. Kilometer to Meters, Centimeters, and Millimeters
  3. C++ Program to Convert Centimeter to Meters and Kilometers

C++ Programs on Volume and Surface Area

  1. Volume and Surface Area of a Cone
  2. Volume and Surface Area of a Cube
  3. Volume and Surface Area of a Cuboid
  4. Volume and Surface Area of a Cylinder
  5. Volume and Surface Area of a Sphere
  6. Check Triangle is Equilateral Isosceles or Scalene
    1. Check Valid or not using Angles
    2. Check Valid or not using Sides
  7. The Perimeter of a Rectangle

C++ Pattern Programs

The following are the c++ programming examples on Star, Alphabets Shapes, and Display Patterns.

  1. Christmas Tree
  2. Alphabet A Pattern
  3. Diamond Star Pattern
  4. Downward Triangle
  5. H Star Pattern
  6. Half Diamond Star Pattern
  7. Hollow Diamond Star Pattern
  8. Hollow Diamond inside a Square
  9. Mirrored Half Diamond Star Pattern
  10. Pyramid Star Pattern
  11. Hollow Pyramid Star Pattern
  12. Inverted Star Pyramid
  13. Hollow Inverted Star Pyramid
  14. Left Pascals
  15. Right Pascals
  16. Hollow Left Pascals
  17. Hollow Right Pascals Star
  18. Rectangle Stars
  19. Hollow Rectangle Stars
  20. Rhombus Star Pattern
  21. Mirrored Rhombus
  22. Hollow Rhombus Stars
  23. Hollow Mirrored Rhombus
  24. C++ program to Print Right Angled Triangle Star Patterns
    1. Simple Example
    2. Hollow
    3. Hollow Inverted
    4. Inverted
    5. Inverted Mirrored
    6. Mirrored
    7. Reverse Mirrored
  25. Left Arrow Stars
  26. Right Arrow Star Pattern
  27. Sandglass Star Pattern
  28. Hollow Sandglass Star Pattern
  29. Square Star
  30. Hollow Square
  31. Hollow Square with Diagonals
  32. Plus Star
  33. V Star
  34. Inverted V Star
  35. W Star
  36. X Star
  37. 8 Star Pattern

C++ Alphabets Pattern

  1. Triangle Of Alphabets
  2. Downward Triangle Mirrored Alphabets
  3. C++ Program to Print Diamond Alphabets Pattern
  4. K Shape Alphabets Pattern
  5. Pyramid Alphabets Pattern
  6. Right Pascals Alphabets
  7. C++ Program to Print Right Triangle Alphabets Pattern
    1. Simple Alphabets Example
    2. Alphabets in Reverse
    3. Character Pattern
    4. Consecutive Alphabets
    5. Consecutive Row Alphabets
    6. Repeated Characters
    7. Incremental Alphabets
    8. Mirrored Alphabets
    9. Inverted Right Triangle Alphabets
  8. Mirrored Right Triangle Alphabets
  9. Left Arrow Alphabets
  10. Right Arrow Alphabets Pattern
  11. Sandglass Alphabets Pattern
  12. Square of Right Increment Alphabets
  13. Triangle Alphabets
  14. Inverted Triangle Alphabets
  15. Triangle of Alphabets in Reverse
  16. Triangle of Same Alphabets
  17. Triangle of Mirrored Alphabets

C++ Number Pattern Programs

Most of these are based on the right angled triangle pattern.

  1. Print 1 and 0 Column
  2. Print 1 and 0 Row
  3. Simple Number
  4. Diamond Number
  5. Downward Triangle Mirrored Numbers
  6. Floyds Triangle
  7. Hollow Box Number
  8. Inverted Right Triangle Numbers in Reverse
  9. Inverted Right Triangle of Descending Order Nums
  10. Inverted Right Triangle of Consecutive Column Num
  11. Inverted Right Triangle of Same Column Num
  12. K Shape Number Pattern
  13. Left Arrow
  14. Left Pascals
  15. Pascal Triangle
  16. Pyramid
  17. C++ Program to Print Right Triangle Numbers Pattern
    1. 1 and 0
    2. Numbers
    3. Consecutive Column Nums
    4. Consecutive Rows Nums
    5. Incremented Nums
    6. Mirrored Nums
    7. Reverse
    8. Numbers in Sine Wave
  18. Right Arrow
  19. Right Pascals
  20. Right Pascals of Multiplication Numbers
  21. Sandglass
  22. Square Number Pattern
  23. Square Rows and Columns with the same numbers
  24. Square With Diagonal Numbers
  25. Square of Left Decrement Nums
  26. Square of Right Increment Nums
  27. Same Nums on all Sides of a Square
  28. Triangle
  29. Triangle of Numbers in Reverse
  30. Triangle of Mirrored Numbers
  31. Inverted Triangle