0

Wher is mistake?

#include <iostream> using namespace std; int main(){ int a, b, c, d; cout <<"Enter a" << endl; cin >> a; cout<<"Enter b"<<endl; cin>>b; cout<<"Enter c"<<endl; d=sqrt(a*a+b*b+c*c); cout<<d; return 0; }

11th Oct 2018, 2:30 PM
Dima Moshko
Dima Moshko - avatar
5 odpowiedzi
+ 2
You're missing: #include <cmath> You need it for the sqrt function
11th Oct 2018, 3:11 PM
fra
fra - avatar
+ 3
Also, there is no cin >> c
11th Oct 2018, 4:44 PM
Anna
Anna - avatar
0
you missed cin>>c; as well for sqrt you should add library <math.h>
15th Oct 2018, 2:12 PM
karishma tejwani
karishma tejwani - avatar
0
All is correct except for the declaration of C and function <math.h>
18th Oct 2018, 4:19 PM
Anirban Nandy
0
Is the declaration of d not needed??
1st Oct 2020, 3:58 PM
DARK PHOENIX
DARK PHOENIX - avatar