+ 1
code doesn't work here
Hi there So i made a simple code but when i try it in sololearn it doesn't work. Anyone know why?
3 Answers
+ 8
Show us the code.
0
some words are dutch sorry for that
#include <iostream>
#include <string>
using namespace std;
int main()
{
long double straal;
string answer;
long double opp;
long double pi;
cout<<"Hello there enter your radius \n";
cin >> straal;
cout <<"Good would you like pi 3.14 or pi 3.14159265 \n";
cout <<"Type yes for 3.14 or type no for 3.14159265 \n";
cin >> answer;
if(answer == "yes"){
pi = 3.14;
straal = straal*straal;
opp = pi*straal;
cout << "Your answer is "<<opp;
}
if(answer == "no"){
pi =3.14159265;
straal = straal*straal;
opp = pi*straal;
cout <<"Your answer is "<<opp;
}
return 0;
}
0
https://code.sololearn.com/cSdemqTykLa4/?ref=app
It works perfectly fine.