Académique Documents
Professionnel Documents
Culture Documents
#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();
}