Multumesc frumos de ajutor :)
V-as ruga in C sau C++
Răspunsuri la întrebare
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double x;
cout << "Introduceti numarul real x: ";
cin >> x;
int optiune;
do {
cout << "\nAlegeti o optiune:\n";
cout << "1 - e^x\n";
cout << "2 - ln(x)\n";
cout << "3 - |x|\n";
cout << "4 - 10^x\n";
cout << "0 - iesire program\n";
cin >> optiune;
switch (optiune) {
case 1:
cout << "e^x = " << exp(x) << endl;
break;
case 2:
cout << "ln(x) = " << log(x) << endl;
break;
case 3:
cout << "|x| = " << fabs(x) << endl;
break;
case 4:
cout << "10^x = " << pow(10, x) << endl;
break;
case 0:
cout << "Iesire program." << endl;
break;
default:
cout << "Optiune invalida." << endl;
break;
}
} while (optiune != 0);
return 0;
}