Hi i want to make my program to restart after displaying the last output. Can anyone please help me as im new in this thing. all helps are really appreciated. thanks
{
int V = 100, R = 100, freq, a, b = 180, minFreq, maxFreq, intvFreq;
float L = 10e-3, C = 10e-6, PI=3.142, anglepol, polZ, Ipol, cart_a, cart_b;
float xL, xC;
char quit, restart;
while (quit != 'q')
{
cout << "\n This is a series RLC circuit program to calculate the current of the circuit\n" << endl;
cout << "\t in Polar and Cartesian form ( 100Hz to 2KHz)\n" << endl;
cout << "\t----R = 100 ohm-------L = 10mH--------C = 10uF------" << endl;
cout << "\t| |" << endl;
cout << "\t--------------AC supply = 100V/45deg----------------" << endl;
cout << "\n Please enter the minimum frequency: \n" ;
cin >> minFreq ;
cout << "\n Please enter the maximum frequency: \n" ;
cin >> maxFreq ;
cout << "\n Enter the frequency interval: \n";
cin >> intvFreq ;
You could use a do-while. Which means you have to place all the code in your main, in a do-while loop. After you do that make the condition for the do-while, true, and it'll restart your program. =]
could you please explain "int argc, char *argv[]" because I can find nothing that will tell me
I think that is the traditional command line arguments for C/C++ main function. As long as your command-line C/C++ program has a main function that need to take in command line arguments, it is retrieved via these two parameters.