#include "stdafx.h"
#include <cmath>
#include <iostream>
using namespace std;
//alidoran
int main()
{ double a, b, c;
cout << "Enter the coefficients of a quadratic equation:"
<< endl;
cout << "\ta: ";
cin >> a;
cout << "\tb: ";
cin >> b;
cout << "\tc: ";
cin >> c;
cout << "The equation is: " << a << "*x*x + " << b << "*x + " << c << " = 0" << endl;
double d = b*b - 4 * a*c;
double sqrtd = sqrt(d);
double x1 = (-b + sqrtd) / (2 * a);
double x2 = (-b - sqrtd) / (2 * a);
cout << "The solutions are:" << endl;
cout << "\tx1 = " << x1 << endl;
cout << "\tx2 = " << x2 << endl;
cout << "check:" << endl;
cout << "\ta+x1*x1 + b*x1 + c = " << a*x1*x1 + b*x1 + c << endl;
cout << "\ta+x2*x2 + b*x2 + c = " << a*x2*x2 + b*x2 + c << endl;
system("pause");
return 0;
}
#include "stdafx.h"
#include "iostream"
using namespace std;
//alidoran
int main()
{
int A = 'A', a = 'a', E = 'E', e = 'e', I = 'I', i = 'i', O = 'O', o = 'o', U = 'U', u='u';
cout << "A=" << A << "\t" << "a=" << a << "\t" << "E=" << E << "\t" << "e=" << e << "\t" << "I=" << I << "\t" << "i=" << i<<"\t" << "O=" << O << "\t" << "o=" << o << "\t" << "U=" << U << "\t" << "u=" << u << endl;
system("pause");
return 0;
}
#include "stdafx.h"
#include "iostream"
using namespace std;
//alidoran
int main()
{
int x=5, y=10, z=20;
cout << "x=" << x << endl << "y=" << y << endl << "z=" << z << endl;
z = x + y++;
cout << "x=" << x << endl << "y=" << y << endl << "z=" << z << endl;
system("pause");
return 0;
}