Vous êtes sur la page 1sur 6

Program 1, to calculate magnetic force.

#include<iostream.h>
#include<conio.h>
void main()
{
int F, L, B, I, sinu;
cout << “enter the value of I”;
cin >> I;
cout << “enter the value of B”;
cin >> B;
cout << “enter the value of L” ;
cin >> L;
sinu=1;
F=I*L*B*sinu;
cout << “the magnetic force calculated is “ << F;
getch();
}
Program 2, to calculate current of 100 charges of a conductor
#include<iostream.h>
#include<conio.h>
void main()
{
int q, i, t;
cout << “enter the value of time for which charges move”;
cin >> t;
q=100;
i=q/t;
cout << “the current calculated is “ << i;
getch();
}
Program 4 ,to find reciprocal of an integer.
#include<iostream.h>
#include<conio.h>
void main()
{
int n, x;
cout << “please enter the value of integer”;
cin >> n;
x=1/n;
cout << “the reciprocal of number is “ << x ;
getch();
}
Program 5, to solve equation
#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
int x, y, t, z;
cout << “please enter the value of t “ ;
cin >> t;
x=2*t;
y=2*t*;
z=5*x+4*y;
cout << “the value of z is “ << z;
getch();
}

Program 6, to covet farenheight to Celsius


#include<iostream.h>
#include<conio.h>
void main()
{
int Fahrenheit, Celsius;
cout “ enter the temperature in Celsius “;
cin >> Celsius;
Fahrenheit=(Celsius*9)/5+32;
cout << “the temperature in Celsius is “ << Celsius << endl;
cout << “the temperature in Fahrenheit is << Fahrenheit;
getch();
}

Program 7, Kelvin to Centigrade


#include<iostream.h>
#include<conio.h>
void main()
{
int Kelvin, Centigrade;
cout << “enter the temperature in Kelvin;
cin >> Kelvin;
Centigrade=273-Kelvin;
cout << “the value of temperature in Kelvin is “ << Kelvin << endl;
cout << “the value of temperature in Centigrade is “ << Centigrade <<
endl;
getch();
}
Program 8, to covet Fahrenheit to Kelvin
#include<iostream.h>
#include<conio.h>
void main()
{
int Tk, Tf;
cout << “enter the value of temperature in Kelvin “ ;
cin >> Tk;
Tf=Tk*9/5-459.67;
cout << “the value of temperature in Kelvin is “ << Tk << endl;
cout << “the value of temperature in Fahrenheit is “ << Tf << endl;
getch();
Program 9, to covet Kelvin to Farehheit
#include<iostream.h>
#include<conio.h>
void main()
{
int Tk, Tf;
cout << “enter the value of temperature in Kelvin “ ;
cin >> Tk;
Tk=Tf*5/9+459.67;
cout << “the value of temperature in Kelvin is “ << Tk << endl;
cout << “the value of temperature in Fahrenheit is “ << Tf << endl;
getch();
Program 10, to calculate series and parallel equivalent resistance of 3
resistors.
#include<iostream.h>
#include<conio.h>
void main()
{
int r,r1,r2,r3,r4;
cout << “enter the value of r1, r2 and r3”;
cin >> r1 >> r2 >> r3;
r=r1+r2+r3;
cout << “the series equivalent resistance is “ << r;
r4=(r1*r2*r3)/(r1*r2+r1*r3+r1+r2);
cout << “the value of equivalent parallel resistance is “ << r4;
getch();

Program 11, to calculate average energy of photon


#include<iostream.h>
#include<conio.h>
void main()
{
int c,h,f,E,u;
cout << “enter the value of wavelength”;
cin >> u;
c=299792458;
f=c/u;
cout << “the value of frequency is “ << f;
cout << “enter the value of Plank’s constant “ << h;
E=h*f;
cout << “the energy of photon is “ << E;
getch();
}
Program 12, to calculate angular momentum of a particle
#include<iostream.h>
#include<conio.h>
void main()
{
int l,r, p, sinu;
cout << “enter the value of r, p “ ;
cin >> r >> p;
cout << “enter the value of sinu “ ;
cin >> sinu;
l=r*p*sinu;
cout << “the value of angular momentum of particle is “ << l ;
getch();
}

Vous aimerez peut-être aussi