C++ Programs

This page includes the most basic and the 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++ programs 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. Last Digit of a Number
  9. Calculate LCM of Two Numbers
  10. Check Leap Year
  11. Check Palindrome Number
  12. Check Perfect Number
  13. Product of Digits in a Number
  14. Calculate Profit or Loss
  15. Prime Factors of a Number
  16. Print 1 to 100
  17. Print Alphabets between A and Z
  18. Print alphabets from a to z
  19. 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. Sum of Series 1²+2²+3²+n²
  42. Sum of Series 1³+2³+3³+n³
  43. Swap Two Numbers
  44. Swap First and Last Digit in a Number

C++ Character Programs

  1. 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

C++ Conversion Programs

  1. Convert Days to years and Weeks
  2. Kilometer to Meters, Centimeters, and Millimeters

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. Perimeter of a Rectangle

C++ Programs on Star, Alphabets Shapes and Display Pattern

The following are the c++ programming examples on 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 Programs

  1. Triangle Alphabets
  2. Downward Triangle Mirrored Alphabets
  3. K Shape Alphabets Pattern
  4. Pyramid Alphabets Pattern
  5. Right Pascals Alphabets
  6. 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
  7. Mirrored Right Triangle Alphabets
  8. Left Arrow Alphabets
  9. Right Arrow Alphabets Pattern
  10. Sandglass Alphabets Pattern
  11. Square of Right Increment Alphabets
  12. Triangle Alphabets
  13. Inverted Triangle Alphabets
  14. Triangle of Alphabets in Reverse
  15. Triangle of Same Alphabets
  16. Triangle of Mirrored Alphabets

C++ Programs on Number Pattern

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

  1. 1 and 0 Column
  2. 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. 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
  23. Square Rows and Columns with 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 Nums in Reverse
  30. Triangle of Mirrored Nums
  31. C++ program to print Inverted Triangle