0% found this document useful (0 votes)
4 views16 pages

C++ Programs TurboC++

The document contains a list of 40 C++ programs designed for Turbo C++, covering various fundamental programming concepts. Each program includes a header for including necessary libraries and a main function with a call to clear the screen and wait for user input. The programs address topics such as factorial calculation, Fibonacci series, prime number checking, and various examples of inheritance and function overloading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views16 pages

C++ Programs TurboC++

The document contains a list of 40 C++ programs designed for Turbo C++, covering various fundamental programming concepts. Each program includes a header for including necessary libraries and a main function with a call to clear the screen and wait for user input. The programs address topics such as factorial calculation, Fibonacci series, prime number checking, and various examples of inheritance and function overloading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

C++ Programs for Turbo C++

1. 1. Factorial of a positive integer

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 1. Factorial of a positive integer

getch();

2. 2. Fibonacci series

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 2. Fibonacci series

getch();

3. 3. Prime number check

#include <iostream.h>

#include <conio.h>
void main() {

clrscr();

// Code here for 3. Prime number check

getch();

4. 4. Sum of first 25 even numbers

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 4. Sum of first 25 even numbers

getch();

5. 5. Sum of first 25 odd numbers

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 5. Sum of first 25 odd numbers

getch();

}
6. 6. Armstrong number check

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 6. Armstrong number check

getch();

7. 7. Even or Odd number check

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 7. Even or Odd number check

getch();

8. 8. Power calculation (a^b)

#include <iostream.h>

#include <conio.h>

void main() {
clrscr();

// Code here for 8. Power calculation (a^b)

getch();

9. 9. Area and Circumference of a circle

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 9. Area and Circumference of a circle

getch();

10. 10. Temperature conversion (Celsius to Fahrenheit)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 10. Temperature conversion (Celsius to Fahrenheit)

getch();

11. 11. Factorial using recursion


#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 11. Factorial using recursion

getch();

12. 12. Sum of digits of a 5-digit number

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 12. Sum of digits of a 5-digit number

getch();

13. 13. Palindrome number check

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();
// Code here for 13. Palindrome number check

getch();

14. 14. Reverse of a number

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 14. Reverse of a number

getch();

15. 15. Inline function example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 15. Inline function example

getch();

16. 16. Copy value from one object to another


#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 16. Copy value from one object to another

getch();

17. 17. Swap two numbers (Call-by-Value, no third variable)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 17. Swap two numbers (Call-by-Value, no third variable)

getch();

18. 18. Swap two numbers (Call-by-Value, with third variable)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 18. Swap two numbers (Call-by-Value, with third variable)
getch();

19. 19. Parameterized constructor example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 19. Parameterized constructor example

getch();

20. 20. Constructor overloading example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 20. Constructor overloading example

getch();

21. 21. Function overloading example

#include <iostream.h>
#include <conio.h>

void main() {

clrscr();

// Code here for 21. Function overloading example

getch();

22. 22. Operator overloading (+ or - operator)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 22. Operator overloading (+ or - operator)

getch();

23. 23. Default constructor example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 23. Default constructor example

getch();
}

24. 24. Multilevel inheritance

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 24. Multilevel inheritance

getch();

25. 25. Function overriding example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 25. Function overriding example

getch();

26. 26. Hierarchical inheritance

#include <iostream.h>

#include <conio.h>
void main() {

clrscr();

// Code here for 26. Hierarchical inheritance

getch();

27. 27. Virtual function example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 27. Virtual function example

getch();

28. 28. Copy constructor example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 28. Copy constructor example

getch();

}
29. 29. Destructor example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 29. Destructor example

getch();

30. 30. Hybrid inheritance example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 30. Hybrid inheritance example

getch();

31. 31. Single inheritance example

#include <iostream.h>

#include <conio.h>

void main() {
clrscr();

// Code here for 31. Single inheritance example

getch();

32. 32. Public & Private member functions

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 32. Public & Private member functions

getch();

33. 33. Multiple inheritance example

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 33. Multiple inheritance example

getch();

34. 34. Scope resolution operator usage


#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 34. Scope resolution operator usage

getch();

35. 35. Greatest number among three numbers

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 35. Greatest number among three numbers

getch();

36. 36. Greatest number among three numbers (duplicate)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();
// Code here for 36. Greatest number among three numbers (duplicate)

getch();

37. 37. Addition of two matrices

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 37. Addition of two matrices

getch();

38. 38. Matrix multiplication (3x3)

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 38. Matrix multiplication (3x3)

getch();

39. 39. Lowercase to Uppercase conversion and vice-versa


#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 39. Lowercase to Uppercase conversion and vice-versa

getch();

40. 40. Roots of a quadratic equation

#include <iostream.h>

#include <conio.h>

void main() {

clrscr();

// Code here for 40. Roots of a quadratic equation

getch();

You might also like