C++ Programs

Use CTRL+F to find the desired program


  1. Write a program in C++ to input roll no, name and marks and display entered details and average marks
  2. Write a program in C++ to find Addition, Subtraction, Multiplication, Division, Remainder and Average of two floating numbers
  3. Write a program in C++ to find the Square and Cube of any number
  4. Write a program in C++ to swap two variables without using third variable
  5. Write a program in C++ to check the number is positive or negative using Conditional Operator
  6. Write a program in C++ to find area of circle
  7. Write a program in C++ to find area of triangle
  8. Write a program in C++ to find simple interest
  9. Write a program in C++ to enter marks of 5 subjects and then calculate percentage
    a.     Percentage > 75 then print “Distinction”
    b.     Percentage > 60 print “First Class”
    c.     Percentage > 50 print “Second Class”
    d.     Percentage > 35 print “Pass”
    e.     Otherwise print “Fail”
  10. Write a program in C++ to check whether the entered year is leap year or not
  11. Write a program in C++ to print prime numbers from 1 to 100
  12. Write a program in C++ to check whether the entered number if prime number or not
  13. Write a program in C++ to find Maximum of 3 number using Conditional Operator
  14. Write a program in C++ to find Maximum of 3 number using Nested If Else
  15. Write a program in C++ to find addition, subtraction, multiplication or division of 2 numbers entered by user using switch case
  16. Write a program in C++ to find out Area of Triangle, Rectangle or Circle using If else (Must be menu driven)
  17. Write a program in C++ to find factorial of entered number
  18. Write a program in C++ to print Fibonacci series upto number entered by user
  19. Write a program to print table of entered number
  20. Write a program to find max digit in entered number (e.g. in 1563 max digit is 6)
  21. Write a program to find summation of digits of any number (e.g. in 1563 summation is 1+5+6+3=14)
  22. Write a program to find summation of first and last digit of a number (e.g. in 1365 summation is 1+5=6)
  23. Write a program to print following pyramids
    *
    **
    ***
    ****
    1
    12
    123
    1234
    1
    22
    333
    4444
    *
    **
    ***
    ****
    1
    21
    321
    4321
    54321
    *
    * *
    * * *
    * * * *
    * * * * *
    1
    1 2
    1 2 3
    1 2 3 4
    1 2 3 4 5
    1
    2 2
    3 3 3
    4 4 4 4
    5 5 5 5 5
    *
    **
    ***
    ****
    ***
    **
    *

    * * * * * *
    * * * * *
    * * * *
    * * *
    * *
    *

    * * * * * * * *
    * * *       * * *
    * *             * *
    *                   * 

    *
    * * 
    * * *
    * * * *
    * * * 
    * *
  24. Write a program to enter 6 elements in array and print square of every element
  25. Write a program to enter 10 elements in array and print the number of even and odd elements in it
  26. Write a program to enter 10 elements in array and print summation and average of elements
  27. Write a program to print max of 10 elements of array
  28. Write a program to sort array in ascending order
  29. Write a program to sort array in descending order
  30. Write a program to find second smallest element of array
  31. Write a program to print Matrix using 2D array
  32. Write a program for addition and subtraction 2 Matrix using 2D array
  33. Write a program for multiplication of 2 Matrix using 2D array
  34. Write a program to find Max element in 2D array (Matrix)
  35. Write a program to convert string from uppercase to lowercase and vice versa
  36. Write a program to count the number of words without using string function
  37. Write a program to copy a string’s value into another without using string function
  38. Write a program to reverse the string without using string function
  39. Write a program to check whether the entered string is Palindrome or not
  40. Write a program to concatenate 2 strings without using string function
  41. Write a program to find addition, subtraction, multiplication and division of 2 numbers using Function
  42. Write a program to find square and cube of any number using Function
  43. Write a program to find factorial of any number using Function
  44. Write a program to print Fibonacci Series using Function
  45. Write a program to find min and max element of an array using Function
  46. Write a program to sort the array using Function
  47. Write a program to print the string in reverse order using Function
  48. Write a program to for factorial using Recursive Function
  49. Write a program to check whether the entered number if Palindrome or not using Recursive Function
  50. Write a program of Structure employee that provides following information: emp_no, emp_name, emp_age, emp_designation, emp_salary, emp_address
  51. Write a program of Structure employee that provides following information for 5 employees: emp_no, emp_name, emp_age, emp_designation, emp_salary, emp_address
  52. Write a program of structure student having roll_no and marks of 3 subjects of 5 students, then print the total marks and percentage of every student
  53. Write a program to make addition of 2 numbers using pointer
  54. Write a program to swap two variables using pointer
  55. Write a program to concatenate 2 strings using pointer
  56. Write a program to sort array using pointer and function
  57. Write a program to read data from file
  58. Write a program to write data into a file
  59. Write a program to append data into already existing file
  60. Write a program to calculate square of any number using Macro
  61. Write a program to assign any constant value (e.g. pi=3.14) to Macro and use it to find area of circle 

Leave a Reply

Contact Form

Name

Email *

Message *

Followers