#include <iostream> // Inlcudes standard input and output commands.
#include <string> // Needed to add a string with a value.
#include <stdlib.h> // Needed to use the command system("pause");
usingnamespace std;
int main ()
{
int O; //Overstaande
int S; //Schuine
int A; //Aanliggende
cout << " Bereken de hoeken van een driehoek. De lengtes moeten worden gegeven in centimeters! " << endl; endl; endl;
cout << " Welke gegevens heb je? " << endl; endl;
cout << " Overstaande lijn in centimeters: " <<
cin >> O >> endl;
cout << " De overstaande lijn is " << O << // This is where I want it to say "the line is "Cin 0" centimeters long.
//I also want to be able to give an integer an unknown value, the value that yet has to be calculate
system("pause"); // Stops .cmd from closing right away.
}
I also want to be able to give an integer an unknown value, the value that yet has to be calculated. For instance, I want to calculate "int A;" but the program must ask all three integers to be put in. First it should ask if there's a value for A, if there isn't then it should skip that and ask for the value of B which there will be and the same goes for C. There will always be one integer which has no value, but it has to be calculated with the SOS CAS TOA.
#include <iostream> // Inlcudes standard input and output commands.
#include <string> // Needed to add a string with a value.
#include <stdlib.h> // Needed to use the command system("pause");
usingnamespace std;
int main ()
{
int O; //Overstaande
int S; //Schuine
int A; //Aanliggende
cout << " Bereken de hoeken van een driehoek. De lengtes moeten worden gegeven in centimeters! " << endl;
cout << " Heb je de overstaande lijn? Vul 0 in voor ""Nee"" " << endl;
cin >> O;
if (O == 0)
{
cout << "Je hebt de gegevens voor de overstaande lijn niet, vul de schuine lijn in. " << endl;
cin >> S;
}
cout << " Overstaande lijn in centimeters: " <<
system("pause"); // Pauses .cmd from closing right away.
}
so first, to conform to c++, all of the basic c-.h headers can be represented as cNameOfHeader, so you can make stdlib.h cstdlib. second what language is this? If i HAD to stereotype i would say it looks russian. third endl makes a newline and is not a variable. so you can't cin>> to it. im guessing you want it to print a newline after the variable. just use cout. fourth for the unknown value just do zero