Physics Lab Manual
Physics Lab Manual
Lab Manual
Name:
Muhammad Ahmad
Roll No:
2023-CS-57
Submitted To:
Mam Nashita Alwaz
Department of Computer Science
Lab Experiment#01
Objective:
To verify the Ohm’s law.
Hardware used:
Intel(R) Core(TM) i5-4310M CPU @ 2.70GHz 2.70 GHz
Software used:
For this purpose we used Ni Multisim 14.3 Software.
Theory:
What is applied physics?
Applied physic is the application of physics to solve scientific or engineering problems. It is usually
considered a bridge or a connection between physics engineering.
Ohm’s law:
Ohm law states that the voltage across the conductor is directly proportional to the current flowing
through it, provided all physical conditions and temperatures remain constant.
V = IR
I = V/R
Circuit diagram:
Procedure:
First of all we connect the resistor with battery of 10V.
Then we connect the two multimeter with the circuit.
Connect the ground with circuit.
First for current and it connect by breaking the circuit.
Second multimeter for voltage and it connect without circuit breaking.
Observation table:
2 5 5 1.667 2.999
3 10 10 3.334 2.999
4 15 15 5 3
5 20 20 6.668 2.999
6 25 25 8.335 2.999
7 30 30 10.001 2.999
Important Points:
We observed following form this in the ohm law circuit.
When the voltage is 0 then the voltage across R1 and across R1 are 0,0 respectively and the
resistance is 0.
When the voltage are increased to 5V then the voltage across R1 and current across R1 is 5V
and 1.667mA respectively and the resistance is 2.999Ω.
When the voltage are increased to 10V then the voltage across R1 and current across R1 is
10V and 3.334mA respectively and the resistance is 2.999Ω.
When the voltage is increased to 30V then the voltage across R1 is 30V and 10.001mA
respectively and the resistance is 2.999Ω.
Graph:
The graph is plotted between the voltage on x-axis and current in y-axis and shows that resistance
remains.
Conclusion:
As shown in table when we keep the values 0 current and voltage are 0 then resistance was also
zero. But when we change the voltage of battery the current and the voltage also changes recorded
by multimeter. But we observed during the whole process the resistance in the circuit remain constant
which show that ohm`s law is obeyed. And the constant resistance is also showed in the form of
graph.
Lab Experiment#2
Objective:
To verify the properties of series circuit.
Series circuit:
The circuit in which different electronic component are connected in series is known as series
circuit.
In this circuit voltage will be divided across each components according to the value of component
but current will remains same.
Procedure:
First of all we connect three resistor of different resistance which are connected in series in
the circuit with DC source.
On connecting the multimeter check the resistance resistance voltage and current.
Circuit Diagram:
Circuit Diagram:
Measurement:
In series circuit the total resistance of a circuit is equal to the sum of all resistance.
Rt = R1+R2+R3
Rt = 1+2+3
Rt = 6kΩ
Circuit Diagram:
Measurement:
In series circuit the current will be same and we find the total current following formula of current.
It = V/Rt
It = 12/6
It = 2mA
Measurement of voltage:
Procedure:
First of all we connect three resistor of different resistance which are connected in series in the
circuit with DC source.
On connecting the multimeter check the resistance voltage and current
Connect the three multimeter without breaking the circuit.
Set the multimeter on V and we find the voltage against each resistor.
The total voltage of this circuit is 12V.
Circuit Diagram:
Measurement:
V1= IR1 = 2*1 =2V
V2 = IR2 =2*2 =4V
V3 = IR3 = 2*3 =6V
Total voltage:
In this circuit the total voltage is the sum of all voltage.
Vt = V1 +V2+V3
Vt = 2+4+6
Vt = 12V
Conclusion:
We conclude that in series circuit the current will remain same but the voltage will be change
according to the value of its component. According to kirchoff voltage rule in this circuit the supply
voltage are equal to the voltage drop across the component.
V supply = V drop
Lab Experiment#3
Objective:
To verify the properties of parallel circuit.
Theory:
Parallel circuit:
A circuit in which more than one path for the current flow is known as parallel circuit .
Current will be divided across each branch in the circuit.
Voltage will be same across each branch.
Procedure:
First of all we connect three resistor of different resistance which are connected parrallel in the
circuit with DC source.
On connecting the multimeter check the resistance resistance voltage and current.
Circuit diagram:
Measurement of resistance:
Procedure:
First of all we connect three resistor of different resistance which are connected parrallel in the
circuit with DC source.
On connecting the multimeter check the resistance.
Connect the three multimeter without breaking the circuit.
Set the multimeter on ohm and we find the resistance of each resistor.
The total resistance of this circuit is 5.45Ω.
Circuit diagram:
Measurement:
1/Rt=1/R1+1/R2+1/R3
=1/10+1/20+1/30
=3+0.05+1
30
=0.1+0.05+0.033
1/Rt = 0.1833
Rt = 5.45Ω
Measurement of voltage:
Procedure:
First of all we connect three resistor of different resistance which are connected parrallel in the
circuit with DC source.
On connecting the multimeter check the voltage.
Connect the three multimeter without breaking the circuit.
Set the multimeter on V and we find the resistance of each resistor.
The voltage are same for each resistor are 2V.
Circuit diagram:
Measurement:
V1=V2=V3=Vt
V=2v
The voltage are same against each resistor
Measurement of current:
Procedure:
First of all we connect three resistor of different resistance which are connected parrallel in the
circuit with DC source.
On connecting the multimeter check the current.
Connect the three multimeter by breaking the circuit.
Set the multimeter on A and we find the current against each resistor.
The total current is 0.367A.
Circuit diagram:
Measurement:
It=I1+I2+I3
I1=V1/R1=2/10=1/5=0.2
I2=V2/R2=2/20=1/10=0.1
I3=V3/R3=2/30=1/15=0.066
It=1/5+1/10+1/15
= 0.2+0.1+0.066
It=6+3+2
30
=11/30
It=0.367A
Observation Table:
3 6V 10k 20k 30k 5.45Ω 5.45Ω 0.599 0.3 0.199 1.098 1.098 6V 6V 6V 6V
Ω Ω Ω
4 9V 10k 20k 30k 5.45Ω 5.45Ω 0.451 0.3 1.648 1.648 9V 9V 49V 9V
Ω Ω Ω 0.898
5 12V 10k 20k 30k 5.45Ω 5.45Ω 1.6 1.399 4.198 4.198 12V 12V 12V 12V
Ω Ω Ω 1.199
6 15V 10k 20k 30k 5.45Ω 5.45Ω 0.751 0.499 2.794 2.794 15V 15V 15V 15V
Ω Ω Ω 1.499
Conclusion:
We conclude that in parallel circuit the current will different but the voltage will be same according to
the value of its component.
Lab Experiment# 4
Objective:
To understand relationship between the electric charges and force of attraction and repulsion
between charges.
Software Used:
Using O Physics website.
Theory:
Columb’s Law:
“The force between two points charges is directly proportional to the product of magnitude of
charges and inversely proportional to the square of the distance between them.”
Mathematical Form:
Two-point charges q1 and q2 separated by a distance r. Then electric force between the charges,
F ∝ q1 q2(1)
1
F∝ (2)
r2
q1q2
F∝
r2
q1q2
F=k
r2
Dependence of K:
Its value depends upon the nature of medium between the charges and system of unit. For free
space.
1
K=
4π⋵
8.85×10-12 C2N-1m-2
1
K=
4 × 3.14 ×8.85 ×10−12
K = 8.9876×109Nm2c-2
So, electric force between charge is:
1 q1q2
F= .
4π⋵ r2
Postulates:
The force between two charges gets stronger as the charge move closer together and the
amount of charge become larger.
The force between two charges is directed along the line connecting their center.
Electric force always occurs in pair. According to Newton’s Third Law like all forces.
Doubling one charge doubles the force.
Doubling both charges quadruples the force.
This relationship is called invers square law because force and distance follow an inverse
square relationship.
For air/vacuum:
1 q1q2
Fa = .
4π⋵ r2
Observation Table1:
In table 1 we take the magnitude of charges are different and take the distance between charges is
same.Then the force between charges measure is different.When the charges sign are different then
the direction of force towards othervise the direction is outwards.
Graph 2:
Conclusion:
Hence proved that the force between two points charges is directly proportional to the product of
magnitude of charges and inversely proportional to the square of the distance between the charges.
Lab Experiment#5
Objective:
To observe the behavior of a charge particle in an electric field.
Software:
https://physlets.org/pp/electromagnetism/gauss_law/default.htm
Theory:
Variation in the electric field can refer to how the strength and direction of the electric field change in
space and time. Understanding these variations is crucial in many areas of physics and engineering,
from the design of electrical equipment to understanding natural phenomena.
Spatial Variation:
The electric field E at a point in space due to a charge distribution can vary based on the position.
This variation is determined by the distribution and nature of the charges creating the field. The
electric field due to a point charge, for instance, decreases with the square of the distance from the
charge.
q is the charge,
r is the distance from the charge,
r is the unit vector in the direction from the charge to the point of interest,
ϵ0 is the permittivity of free space.
Temporal Variation:
The electric field can also change over time. This temporal variation can be caused by changing
charge distributions or by electromagnetic waves. Maxwell's equations describe how electric and
magnetic fields propagate and interact over time.
Field Variation:
Static Fields:
In electrostatics, the electric field is created by stationary charges and is time-invariant. The field can
vary in space but not in time.
Dynamic Fields:
In electrodynamics, the electric field can vary both in space and time. This includes fields created by
moving charges, time-varying current distributions, and electromagnetic waves.
Boundary Conditions:
The behavior of electric fields at the boundaries of different media can cause variations. The electric
field perpendicular to the surface of a conductor is zero inside the conductor in electrostatic
equilibrium. At the interface between two materials with different dielectric constants, the
perpendicular component of the electric field changes.
Examples of Electric Field Variation:
Near Conductors:
The electric field near a conductor's surface is stronger if the surface charge density is higher. This
leads to variations in the electric field near sharp points or edges.
Capacitors:
In a parallel plate capacitor, the electric field between the plates is uniform, but it drops off outside the
plates. If the capacitor is charged and then disconnected, the field will be static; if it’s part of an AC
circuit, the field will vary with time.
Antennas:
Antennas emit electromagnetic waves, creating time-varying electric fields that propagate through
space. The variation in the field's strength and direction depends on the antenna's design and the
frequency of the transmitted signal.
Observation Table:
Sr Electric Distance Charge Direction on Time Particle
NO Field between on particle in Electric spent in Electric
. plates particle Field Field
1 200 5 1.1 Up 200 ns
2 370 5 -2 Up 116 ns
3 540 5 -5.8 Up 57 ns
4 810 5 -3 Up 64 ns
5 1230 5 0.5 Up 128 ns
6 1310 5 2.5 Down 110 ns
7 1550 5 4.7 Down 37 ns
8 1660 5 6.2 Down 31 ns
Lab Experiment #7
Objective:
To Illustration of flux and gaussian surface by bar graph.
Software:
Using Phys let Physics by Christian.
Idea:
Determination through bar graph of flux:
The bar through four Gaussian surface graph shows the flux
1)Green surface:
When we move the cursor at the Gaussian surface the coordinates will be occurred.
The flux will be zero at the Gaussian surface but at the center flux will be maximum
(62.8).
2)Red surface:
When we move the cursor at the Gaussian surface the coordinates will be occurred.
The flux will be zero at the Gaussian surface but at the center flux will be maximum
(62.8).
3)Orange surface:
When we move the cursor at the Gaussian surface the coordinates will be occurred.
The flux will be zero at the Gaussian surface but at the center flux will be maximum
(62.8).
4)Blue surface:
When we move the cursor at the Gaussian surface the coordinates will be occurred.
The flux will be zero at up and down at the Gaussian surface.
The charge will be parallel but in opposite direction.
Mathematically:
Gauss's law relates the flux to the charge enclosed (enclosed) in a Gaussian surface:
ϕ = ∫ E dA = ∫ E cosθ dA
E is the electric field, dA is the unit area normal to the surface, θ is the angle between the electric field
vector and the surface normal.
Permittivity of space:
ε0. is the permittivity of free space8.85 × 10-12 C2 N-1m-2.
Explanation:
As long as the point charge is enclosed, the flux is the same and is equal to q enclosed/ε0. When the
charge is not enclosed, the flux is always zero. Notice that both the green and red Gaussian surfaces
can be moved to either enclose or not enclose the charge. Therefore, the two fluxes should, and do,
agree. However, only when these surfaces are centered on the charge can you use them to
determine the electric field.
The orange surface has a different symmetry from the point charge.
With the orange surface, why doesn't the shape matter in finding the flux?
Again, what matters is whether the charge is enclosed or not. Move the surface to a point where the
flux is zero. Is the electric field zero at the surface of the box? If the electric field is not zero, why is
the flux zero? If you think about flux as a flow of electric field through an area, then when there is no
charge inside, the electric field that comes into the box must also leave. There is no source of electric
field inside the box. However, the cubical box no longer has the same symmetry of the point charge.
While the flux is zero for these scenarios, the value of the flux cannot be used to determine the
electric field.
The integral ∫ E cosθ dA is not equal to the integral E ∫ cosθ dA because E is not uniform across the
Gaussian surface.
Observation Table:
Gaussian Coordinates of Flux
Surfaces surfaces
Green Surface X= +2.84 y=+2.28 0
X= 2.56 y=1.52 0
X= -3.84 y=2.16 0
X=0.84 y=0.76 62.8
Red Surface X=3.12 y=3.16 0
X=-4.12 y=3.32 0
X=-4.08 y=-3.44 0
X=-0.12 y=-0.04 62.8
Orange Surface X=2.8 y=2.88 0
X=-3.0 y=2.6 0
X=-2.72 y=-2.04 0
X=-0.32 y=-0.12 62.8
Blue Surface X=2.92 y=2.56 0
X=-2.72 y=2.36 0
X=-1.52 y=0.16 62.8
X=1.56 y=-0.2 -62.8
Conclusion:
The integral ∫ E cosθ dA is not equal to the integral E ∫ cosθ dA because E is not uniform across the
Gaussian surface. In this lab we find the electric flux with red, green, orange and blue surface. We
take the x-component and y-component at different position on different surface and then we find the
total electric flux
Lab Experiment#8
Objective:
To understand the concept of equipotential surface due to point charge.
Software used:
By using PHET simulation platform.
Theory:
What is equipotential surface?
The surface, the locus of at points at the same potential is known as equpotential
surface.
No work us required to move a charge from one point to another on the equipotential
surface.
Work done in moving a charge between two points in an equipotential surface is zero
W = oq(Na -Vb)
W=0
Observation:
We observe the equipotential surface by using three different pattern:
Simulation Activity
Simulation Activity Go to http://bit.ly/electric_field_sim
Using the simulation, draw the Equipotential surface (lines) with regular interval (e.g. 2V)
Equpotential surface pattern Graphs of v against r
Conclusion:
We conclude that when the radius is increased then the voltage decreased in all condition.
Lab Experiment#9
Objective:
To observe the change in resistivity of conductor by changing the length of the
material.
Software:
https://www.thephysicsaviary.com/Physics/Programs/Labs/
ResistanceOfWireChallengeLab/
https://phet.colorado.edu/en/simulations/resistance-in-a-wire
Theory:
Resistivity, denoted by ρ is a fundamental property of materials that quantifies how
strongly a material opposes the flow of electric current. It is intrinsic to the material and
is independent of its shape and size. The unit of resistivity is ohm-meter (Ωm).
Resistivity of Different Materials:
Conductors:
Metals
Copper: ρ≈1.68×10−8 Ωm
Silver: ρ≈1.59×10−8 Ωm
Aluminum: ρ≈2.82×10−8 Ωm
Metals have low resistivity, typically in the range of 10−8 Ωm this low resistivity is due to
the presence of free electrons that can move easily through the lattice structure,
facilitating electrical conduction.
Semiconductors:
Silicon: ρ≈1 Ωm
Germanium: ρ≈0.46 Ωm
Semiconductors have resistivity between those of conductors and insulators. Their
resistivity can be significantly altered by doping, which introduces impurities into the
material to increase its conductivity. Intrinsic semiconductors have higher resistivity,
which decreases with increasing temperature.
Insulators:
Glass: ρ≈1010−1014 Ωm
Rubber: ρ≈1013 Ωm
Ceramics: ρ≈1012 Ωm
Insulators have very high resistivity, often greater than these materials have tightly
bound electrons that are not free to move, thus they do not conduct electric current
under normal conditions.
Superconductors:
Yttrium Barium Copper Oxide (YBCO): ρ≈0 Ωm (below critical temperature)
Superconductors exhibit zero resistivity below a certain critical temperature. This
property allows for the perfect conduction of electricity without energy loss, which is not
possible in regular conductors.
Factors Affecting Resistivity:
Temperature:
For most conductors, resistivity increases with temperature due to increased lattice
vibrations that scatter electrons. For semiconductors, resistivity decreases with
temperature as more charge carriers are generated.
Material Purity and Composition:
Impurities and alloying can significantly affect resistivity. Adding impurities to
semiconductors (doping) changes their resistivity dramatically.
Physical State:
Amorphous materials generally have higher resistivity compared to their crystalline
counterparts due to irregular atomic structure.
Procedure
Take a length by ruler from site.
Check the current from site.
Current will be change as change in length.
After clicking area button area will be shown and count the small units of one
block each block is 0.1mm.
Multiplying units and block measurement:
5×0.1mm
Then convert the block measurement o.1mm into 0.1 m then calculate the area
by formula:
A= πr2
And calculate resistance by formula:
R= V/L
Calculate resistivity by formula:
ρ = R×A/L
Observation Table
Sr No. L(m) A (m2) V I(A) R (Ω) ρ (Ωm)
1 1.7 m 7.85×10-7m 12.0 5.1A 7.05 Ω 3.25 Ωm
2 2.2 m 7.85 ×10-7m 12.0 0.4A 5.45 Ω 1.94 Ωm
3 3.3 m 7.85 ×10-7m 12.0 0.3A 3.63 Ω 0.86 Ωm
4 4.1 m 7.85 ×10-7m 12.0 2.1A 2.92 Ω 0.55 Ωm
5 5.6 m 7.58 ×10-7m 12.0 1.7A 2.14 Ω 0.29 Ωm
Conclusion
Resistivity is a key property that determines how materials interact with electric fields
and currents. Conductors have low resistivity and are widely used in electrical wiring
and components due to their efficiency in carrying current. Semiconductors, with their
intermediate resistivity, are essential in electronic devices because their conductivity
can be precisely controlled. Insulators, with high resistivity, are crucial for preventing
unwanted flow of current and ensuring safety in electrical systems. Superconductors,
which have zero resistivity at low temperatures, though practical applications are
currently limited by the challenges in maintaining the necessary conditions for
superconductivity.
Lab Experiment#10
Objective
To understand the measurement of hall voltag through Hall Effect.
Software
Using
https://mpvau.vlabs.ac.in/modernphysics/Hall_Effect_Experiment/experiment.html
Theory:
The Hall Effect, discovered by Edwin Hall in 1879, is a phenomenon observed in
electrical conductors, semiconductors, and other materials where an electric current
flows. It occurs when a magnetic field is applied perpendicular to the direction of the
current flow, resulting in the development of a transverse electric field.
Table 1:
Sr.No Material Supply Induced Induced
Current(A) Voltage(V) Current(A)
1 Germanium 1 28.75 1.0
2 Germanium 2 57.51 1.0
3 Germanium 3 86.27 1.0
4 Aluminum 1.5 867.11 1.0
5 Aluminum 2.5 1445.19 1.0
6 Aluminum 3.5 2023.27 1.0
7 Copper 4 2964.50 1.0
8 Copper 4.5 3335.06 1.0
9 Gold 5 5187.87 1.0
10 Gold 3 3112.72 1.0
Observation Table 2:
Select the material.
And select the measurement of thickness. when we change the thickness then
the voltage are change for all materials.
Induced voltage will be induced.
Current will be induced. It will be a constant.
Table 2:
Sr.No Material Thickness(mm Induced Induced
) Voltage(V) Current(A)
1 Germanium 0.1 28.75 1.0
2 Germanium 0.2 14.37 1.0
3 Germanium 0.3 9.58 1.0
4 Aluminum 0.4 144.51 1.0
5 Aluminum 0.5 115.61 1.0
6 Aluminum 0.6 96.34 1.0
7 Copper 0.7 105.87 1.0
8 Copper 0.8 92.64 1.0
9 Gold 0.9 115.28 1.0
10 Gold 0.5 207.51 1.0
Conclusion:
The Hall Effect is a fundamental phenomenon that has significant practical applications
in various fields, from industrial automation to consumer electronics. It provides
valuable insights into the properties of materials and is instrumental in the development
of sensors and measurement devices.
Lab Experiment#11
Objective:
Demonstration of Ampere’s law.
Software:
Using https://codepen.io/person127/project/full/AJPPaN
Theory:
Ampere’s law states that “The magnetic field created by an electric current is proportional to the size
of that electric current with a constant of proportionality equal to the permeability of free space”.
Formula:
I = P(watt) / V(volt)
We demonstrate the ampere’s law in different scenarios.
Scenarios:
1)Solenoid:
Long wire
Coaxial Wire
Observation Table:
Sr Conditio Amperian loop Magnetic field
n n
o
1 Solenoid B=0
3 Coaxial B=-2.656006543940496e-7
wire
Lab Experiment#12
Objective:
Demonstration of Faraday’s law.
Software:
Using https://phet.colorado.edu/sims/html/faradays-law/latest/faradays-law_all.html
Theory:
Faraday’s law states that “the magnitude of the induced emf in a conductor is directly proportional to
the rate of change of magnetic flux”.
Procedure:
When magnet at rest there is a no deflection.
When magnet moves towards coil the emf induced in a negative direction.
When magnet is held stationary at same position there is no emf induced.
When magnet moves away from the coil emf induced in positive direction.
When magnet is moved rapidly in and out of the coil positive and negative
direction according to its movement.
Observation Table
Position of Magnet Deflection in galvanometer
Magnet at rest No deflection.
Magnet moves towards coil. Emf induced in negative direction.
Magnet is held stationary at No Emf induced.
same position.
Magnet moves away from the Emf induced in positive direction.
coil.
Magnet is moved rapidly in In positive and negative direction
and out of the coil. according to its movement.
Conclusion
Based on the observations provided, we can draw some conclusions about the relationship between
the motion of a magnet and the induced electromotive force (emf) in a coil:
No Deflection at Rest:
When the magnet is at rest relative to the coil, there is no change in the magnetic field
passing through the coil. Therefore, no emf is induced.
Negative Emf when Magnet Moves Towards the Coil:
As the magnet moves towards the coil, the magnetic flux through the coil increases,
inducing an emf. According to Lenz's Law, the induced emf opposes the change in
magnetic flux. Since the magnetic flux is increasing, the induced emf will oppose this
increase, resulting in a negative emf.
No Emf Induced when Magnet is Stationary at the Same Position:
If the magnet is held stationary at the same position relative to the coil, there is no change
in the magnetic flux passing through the coil, hence no emf is induced.
Positive Emf when Magnet Moves Away from the Coil:
As the magnet moves away from the coil, the magnetic flux through the coil decreases,
inducing an emf. Again, according to Lenz's Law, the induced emf opposes the change in
magnetic flux. Since the magnetic flux is decreasing, the induced emf will oppose this
decrease, resulting in a positive emf.
Emf Depends on Rapid Movement:
When the magnet is rapidly moved in and out of the coil, the induced emf changes
direction based on the direction of movement of the magnet relative to the coil. This is
because the rate of change of magnetic flux is higher when the magnet is moved rapidly,
causing the induced emf to change direction accordingly.
Setup:
We have a circuit setup where we can measure voltage (V) and current (A) using appropriate
instruments like voltmeters and ammeters.
We also have materials of known properties like resistance, length, and area.
1.Calculating Resistance:
We can measure the voltage and current across an unknown resistor in the circuit.
The program calculates the resistance of the resistor using Ohm's Law (R = V/I).
2.Calculating Voltage:
We have a known resistor and measure the current passing through it.
The program calculates the voltage drop across this resistor using Ohm's Law (V = IR).
3.Calculating Current:
We have a known resistor and measure the voltage across it.
The program calculates the current passing through this resistor using Ohm's Law (I = V/R).
4.Calculating Resistivity:
We have a wire of known length and cross-sectional area, and we can measure its resistance.
The program calculates the resistivity of the wire material using the formula (ρ = RA/L), where R is
resistance, A is area, and L is length.
5.Calculating Conductivity:
Once we have the resistivity, you can calculate the conductivity of the wire material using the formula
(σ = 1/ρ).
#include <iostream>
#include <cmath>
using namespace std;
// Function to calculate resistance using Ohm's Law (R = V/I).
double calculateResistance(double voltage, double current)
{
if (current == 0) {
cout << "Cannot divide by zero. Current should be non-zero." << endl;
return -1;
}
return voltage / current;
}
int main() {
double voltage, current, resistance, length, area, resistivity;
return 0;
}