Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char more, equation;
- float B,I,a;
- cout<<"\n\n\t Determine the magnetic field \n\t providing your desired values \n\n";
- level1:
- cout<<"\n\t Enter the values of current I in amp \n\t and \n\t the distance from a wire a in metre:";
- cout<<"\t\t\t\n\t current I=";
- cin>>I;
- cout<<"\t\t Distance from the wire, a=";
- cin>>a;
- cout<<"\t press y for do it";
- cin>>equation;
- if (equation=='y')
- {
- B=2*0.0000001*1/a;
- cout<<"\n\t\t"<<B<<" Tesla \n\t is the value of the magnetic field";
- }
- cout<<"n\n\t Do you want to calculate more? \n\t If yes please press y\n\t\t\t and \n\t If no please press n to end the program";
- cin>>more;
- if (more=='y')
- {
- goto level1;
- }
- else
- {
- cout<<"\n\t\t\t Thank you for using the programme \n\t\t\t Good Bye";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment