C++ Programs | C++ Practice Programs | Practical C++ Programming

1. Write a program to print “Welcome to C++”.




 Output:

 



2. Write a program to add two numbers.




 Output:

 



 3. Write a program to swap two numbers.




 Output:

 


4. Write a C++ program to calculate simple interest.



    

  Output:

 


 5. Write a program to check whether a number is even or odd.




Output:


 
 



  6.  Write a program to check whether a year is leap year or not.



  Output:

 

 


  7. Write a C++ program to find the largest number among three numbers




    
  Output:


 



8. Write a C++ program to find the maximum of three numbers using conditional operators.


     


Output:

               



 


9. Write a C++ program to check whether a character is vowel or not using switch case.




  Output:





  10. Write a C++ program to print 1st 100 natural numbers.

                             OR

  Write a program in C++ to print the number from 1 to 100.




  Output:




 11. Write a program to calculate sum of first n natural numbers.



  Output:





 12. Write a program to print elements of a one dimensional (1D) array.


      


O  Output:

       



     13. Write a program to print elements of a one dimensional (1D) array taking input from user.

    


         
      Output:
    
    



14. Write a program to print sum and average numbers of array elements.
    
 

    
     Output:


        





15. Write a program to calculate total and average marks of 5 subjects using array.


       
    
    
    Output:


       



    16. Write a program to print elements of a two dimensional (2D) array.


         



     Output:
   
    
                    



    

     17. Write a program to read and print elements of a two dimensional (2D) array.


  

    
  Output:




18. Write a C++ program to add two matrices.




  Output:




19. Write a program to add two numbers using class and objects.


         
         


    Output:



20. Write a program to add two numbers using inheritance.


    
    Output:
     
    



21. Write a program to implement stack through class and objects.

 



  Output:



 22.   Write a C++ program to implement stack using array.





    Output:
    
    






 





Post a Comment

0 Comments