You are on page 1of 64

OBJECT ORIENTED PROGRAMMING USING C++

PRACTICL FILE
BCA- 253
BACHELORS OF COMPUTER APPLICATION
GURU GOBIND INDRAPRASTH SINGH UNIVERSITY

SESSION 2020-2023
SUBMITTED TO – SUBMITTED BY-

MS. Ambooj NAME-Chirag Aggarwal

(Assistant Professor) Enrollment no.- 01217002020

BCA Department BATCH: BCA 3 rd SEMESTER

SHIFT: MORNING

TECNIA INSTITUTE OF ADVANCE STUDIES


NAAC ACCREDITED GRADE “A” INSTITUTE

(Approved by AICTE, Ministry of HRD Govt. of India & Indraprasth university Delhi)

PSP, Institutional Area Madhuban chowk , Rohini, New Delhi-110085


INDEX
S.NO. PROGRAMS PAGE NO. SIGNATURE

1. Write a program to print hello world

2. Write a program to print your Resume.

3. Write a program to print arithmetic


operators
4. Write a program to print swap two
variables using third variable.
5. Write a program to find quotient and
remainder by user input
6. Write a program to demonstrate all the
logical operators in a program
7. Write a program to check whether number
is even or odd input taken by user
8. Write a program to check whether leap
year input taken by user
9. Write a program to check whether number
is negative or positive by nested if
10. Write a program to demonstrate all the
relational operations in a program
11. Write a program to print the size of data
type
12. Write a program to swap values without
using third variable
13. Write a program to calculate result input
by user taking 5 subjects.
14. Write a program to check whether the
alphabet is vowel or constant.
15. Write a program to check the largest
number three given by user.
16. Write a program to print number from 0
to 10 using for loop.
17. Write a program to find factorial of a
number given by user.
18. Write a program to print pattern.
19. Write a program of switch cases.
20. Write a program to print the table of a
number.
21. Write a program to print numbers using
do-while loop.
22. Write a program to print sum of positive
number only.
23. Write a program to print sum of odd and
even numbers.
24. Write a program to demonstrate goto
statement.
25. Write a program to demonstrate break
statement.
26. Write a program to demonstrate continue
statement.
27. Write a program to demonstrate new and
delete statements
28. Write a program to demonstrate arrays
29. Write a program to calculate Max and Min
using 1D array.
30. Write a program to get addition using 2d
arrays.
31. Write a program to print length of a name
32. Write a program to calculate area and
volume of cuboid using class
33. Write a program to retrieve and display
students detail and their marks using class
34. Write a program to Implement Instance
Variable
35. Write a program to Implement Global
Variable
36. Write a program to Implement Local
Variable
37. Write a program to calculate the total
amount of product and generate the bill of
the product using class and declare data
member function outside the class
38. Write a program to check whether the
program is prime or not
39. Write a program of call by value
40. Write a program of call by reference
41. Write a program of Inline Function
42. Write a program to print factorial of a
number using recursion
43. Write a program to print Fibonacci series
of a number using recursion
44. Write a program to declare function
before the main function.
45. Write a program to declare function after
the main function.
46. Write a program to declare function with
two data types.
47. Write a program to demonstrate function
overloading.
48. Write a program to find area of square,
triangle, circle and rectangle using
function overloading.
49.
50.

PROGRAM 1

AIM:- Write a program to print “Hello World” .

CODE:-
OUTPUT:-

PROGRAM 2

AIM:- Write a program to print your Resume .

CODE:-
OUTPUT:-

PROGRAM 3

AIM:- Write a program to perform all arithmetic operators .

CODE
OUTPUT:-
PROGRAM 4
AIM:- Write a program to swap two variables using third variable.

CODE:-

OUTPUT:-
PROGRAM 5

AIM:- Write a program to find quotient and remainder by user input.

CODE:-

OUTPUT:-
PROGRAM 6

AIM:-Write a program to demonstrate all the logical operators in a program.

CODE:-

OUTPUT:-
PROGRAM 7

AIM:-Write A Program To Check Whether Number Is Even Or Odd Input


Taken By User.

CODE:-

OUTPUT:-
PROGRAM 8

AIM:- Write A Program To Check Whether Leap Year Input Taken By User.

CODE:-

OUTPUT:-
PROGRAM 9

AIM:-Write A Program To Check Whether Number Is Negative Or Positive


By Nested If.

CODE:-

OUTPUT:-
PROGRAM 10

AIM:-Write a program to demonstrate all the relational operations in a


program.

CODE:-

OUTPUT:-
PROGRAM 11

AIM:- Write a program to print the size of data type.

CODE:-

OUTPUT:-
PROGRAM 12

AIM:-Write a program to swap values without using third variable.

CODE:-

OUTPUT:-
PROGRAM 13

AIM:- Write a program to calculate result input by user taking 5 subjects.

CODE:-

OUTPUT:
PROGRAM 14

AIM:- Write a program to check whether the alphabet is vowel or constant.

CODE:-

OUTPUT:-
PROGRAM 15

AIM:-Write a program to check the largest number three given by user.

CODE:-
OUTPUT:-
PROGRAM 16

AIM:-Write a program to print number from 0 to 10 using For Loop.


(A) Straight Order:-

CODE:-

OUTPUT:
PROGRAM 17

AIM:-Write a program to find factorial of a number given by user.

CODE:-

OUTPUT:-
PROGRAM 18

AIM:-Write a program to print patterns.

CODE:-
(A) * PATTERN

CODE:-

OUTPUT:-
PROGRAM 19

AIM:-Write a program of switch cases.

(A)Finding Character is vowel or constant?

CODE:-
OUTPUT:-
(B)Finding Grades

CODE:-
OUTPUT:-
PROGRAM 20

AIM:-Write a program to print the table of a number.

CODE:-

OUTPUT
PROGRAM 21

AIM:-Write a program to print numbers using do-while loop.

CODE:-

OUTPUT:-
PROGRAM 22

AIM:-Write a program to print sum of positive number only.

CODE:-

OUTPUT:-
PROGRAM 23

AIM:-Write a program to print sum of odd and even numbers.

Method 1:- Direct SUM

CODE:-

OUTPUT:-
METHOD 2:- Sum and numbers also

CODE:-

OUTPUT
PROGRAM 24

AIM:-Write a program to demonstrate goto statement.

CODE:-

OUTPUT:-
PROGRAM 25

AIM:-Write a program to demonstrate break statement.

CODE:-

OUTPUT:-
PROGRAM 26

AIM:-Write a program to demonstrate continue statement.

CODE:-

OUTPUT:-
PROGRAM 27

AIM:-Write a program to demonstrate new and delete statement.

CODE:-

OUTPUT:-
PROGRAM 28

AIM:-Write a program to demonstrate arrays.

CODE:-

OUTPUT:-
PROGRAM 29

AIM:-Write a program to implement 1D array and find Max and Min


Number.

CODE:-

OUTPUT:-
PROGRAM 30

AIM:-Write a program To Addition of number using 2D Array.

CODE:-

OUTPUT:-
PROGRAM 31
AIM:-Write a program to print a length of a Name.

CODE:-

OUTPUT:-

PROGRAM 32
AIM:-Write a program to calculate volume and area of cuboid using class.

CODE:-

OUTPUT:-
PROGRAM 33

AIM:-Write a program to retrieve and display student personal details and


marks.

CODE:-
OUTPUT:-
PROGRAM 34

AIM:-Write a program to implement Instance Variable.

CODE:-

OUTPUT:-
PROGRAM 35

AIM:-Write a program to implement Global Variable.

CODE:-

OUTPUT:-
PROGRAM 36

AIM:-Write a program to implement Local Variable.

CODE:-

OUTPUT:-
PROGRAM 37

AIM:-Write a program to calculate the total amount of product and generate


the bill of the product using class and declare Data Member Function outside
the class.

CODE:-

OUTPUT:
-
PROGRAM 38

AIM:-Write a program to check whether the number is prime or not.

CODE:-
OUTPUT:-
PROGRAM 39

AIM:-Write a program of Call by Value.

CODE:-

OUTPUT:-
PROGRAM 40

AIM:-Write a program of Call by Reference.

CODE:-

OUTPUT:-
PROGRAM 41

AIM:-Write a program of Inline Function.

CODE:-

OUTPUT:-
PROGRAM 42

AIM:-Write a program to print factorial of a number using recursion.

CODE:-
OUTPUT:-

PROGRAM 43

AIM:-Write a program to print Fibonacci Series of a number using recursion.

CODE:-
OUTPUT:-

PROGRAM 44

AIM:-Write a program to declare function before the main function.


CODE:-

OUTPUT:-

PROGRAM 45
AIM:-Write a program to declare function after the main function.

CODE:-

OUTPUT:-

PROGRAM 46
AIM:-Write a program to declare function with two data types.

CODE:-

OUTPUT:-
PROGRAM 47

AIM:-Write a program to demonstrate function overloading.

CODE:-

OUTPUT:-
PROGRAM 48

AIM:- Write a program to find area of square, circle, rectangle and triangle
using function overloading.

CODE:-
OUTPUT:-

You might also like