Please guide me in solving my problem

I am a beginner, learning and self taught. I've written the following program for electronic calculations. I want to select the correct equasion ONLY and find the unknown and ignore the rest of the program. I do not know how to accomplish what I would like for the program to do. Your help is sincerely appreciated...Thank you, John

#include "stdafx.h"
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
using namespace std;
char sue;
double C;
double F;
double Fsquared;
double L;

// The equation for finding L, C or F is: LC = 25330/(F^2)

int main()
{
cout << "Find the value of L, C and F\n\n";

cout << "Enter the unknown L, C or F that you want to find\n\n";

//finding F
cout << "Enter Inductance value for L \n";
cin >> L;
cout << "Enter Capacitance value for C \n";
cin >> C;

F = (sqrt(25330/(L * C)));

cout << "The value of F in MHz is " << F;

//Finding L
cout << "Enter Capacitance value for C in pf \n\n";
cin >> C;
cout << "\n";
cout << "Enter Frequency value in MHz for F \n\n";
cin >> F;
cout << "\n";

L = 25330/((F * F) * C);

cout << "The value of L in uH is " << L;

//Finding C
cout << "Enter the Inductance value for L in uH \n\n";
cin >> L;
cout << "\n";
cout << "Enter the Frequency value in MHz for F \n\n";
cin >> F;
cout << "\n";
C = 25330/((F * F) * L);

cout << "The value for Capacitance in pf is " << C;

cin >> sue;

return 0;
}
Ask the user for the unknown they wish to find. Use the appropriate function to find it.
Topic archived. No new replies allowed.