Professional Documents
Culture Documents
Ex.No.: 3 Name:
FUNCTION OVERLOADING, DEFAULT ARGUMENTS IN C++ -
Date : APPLICATION TO SOLVE ELECTRIC CIRCUITS
Roll no:
Section:
Objective(s):
To implement Function overloading, default arguments in C++ - application to solve electric circuits using
C++ program.
Problem Statement(s):
Implementation of Function overloading and default arguments
Use the overloaded function to calculate the current through a circuit consisting of three
resistances in series and a 10V source. Overloaded functions can be differentiated using the
number of arguments passed to it.
Use default arguments to find the power dissipated across the circuit.
Example
Program-2
code:
Program 1 :
Program 2 :
Discussion on output:
Marks