No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
My program is working perfectly but when I want to initialize the default constructor which is all zero's it prints -9.25596e+061 . Hier is the code : class Sales { private: static const int QUARTERS = 4; public: double sales[QUARTERS]; double average; double max; double min; Sales(); Sales( double ar[]); … |
|
#include "stdafx.h" #include <stdio.h> #include <math.h> #include <iostream> using namespace std; int main() { int a; int b; int c; double X1; double X2; double D; cout<<"a="; cin>>a>>endl; cout<<"b="; cin>>b>>endl; cout<<"c="; cin>>c>>endl; X1 = (-b+sqrt((b*b)-(4*a*c)))/(2(a)); X2 = (-b-sqrt((b*b)-(4*a*c)))/(2(a)); D =(b*b)-(4*a*c)); if (D >= 0) { cout<<"..."<<X1<<X2<<endl; } if (D < … |