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. Print Even Numbers
  21. Print Multiplication Table
  22. Print First 10 Natural Numbers
  23. Print First 10 Natural Numbers in Reverse
  24. Print N Natural Numbers
  25. Print Natural Numbers in Reverse
  26. Print First 10 Odd Natural Numbers
  27. Print Odd Numbers
  28. Reverse a Number
  29. Square Root of a Number
  30. Square of a Number
  31. Standard Deviation
  32. Strong Number
  33. Student Grade
  34. Student Marks
  35. Sum of Digits in a Number
  36. Sum of Even Numbers
  37. Sum of Even and Odd
  38. Sum of First and Last Digit of a Number
  39. Sum of Natural Numbers from 1 to N
  40. Sum of Odd Numbers
  41. Find Sum of Series 1²+2²+3²+n²
  42. C++ Program to find Sum of Series 1³+2³+3³+n³
  43. Swap Two Numbers
  44. 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. 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