Documente Academic
Documente Profesional
Documente Cultură
MCA-II (SEM-III)
2) Write a function power() to raise a number m to power n. the function takes double value
for m and int value for n and returns the result. Use a default value of 2 for n to make
function calculate squares when this argument is omitted. Write a main function that gets
the value of m and n from the user to test the function.
3) Write a program to calculate area of square and rectangle. Use separate function for
square and rectangle. Use concept of function overloading. Both the functions should
return values to calling function.
4) Write a program to read matrix of size m x n and display it. Allocate memory for matrix
dynamically.
5) Write a C++ program to swap two integers. Use pass by value, pass by reference and pass
by address mechanisms. Main function will read two integers, pass those to swap
functions. Display value before and after swapping in main function.
6) Write a C++ program to add two integer values , float values, double values ,char values
and two strings. Use concept of function overloading. Both the functions should return
values to calling function.
Class: Student_Academic
Data Members:
Integer Array to store marks of 6 subjects
Total
Percentage
Member functions:
To read marks of 6 subjects
To calculate total and percentage
Write a main function that prints report cards of N students.
Note: - To print report card for student, function needs data from both the classes (i.e from
Student_Personal and Student_Acedemic).