#include <iostream> using namespace std; int main() { double reel1, imaginaire1, reel2, imaginaire2; cout << "Entrer reel1, imaginaire1, reel2 et imaginaire2 : "; cin >> reel1 >> imaginaire1 >> reel2 >> imaginaire2; double somme_reelle = reel1 + reel2; double somme_imaginaire = imaginaire1 + imaginaire2; double produit_reelle = (reel1 * reel2) - (imaginaire1 * imaginaire2); double produit_imaginaire = (reel1 * imaginaire2) + (imaginaire1 * reel2); double moyenne_reelle = (reel1 + reel2) / 2; double moyenne_imaginaire = (imaginaire1 + imaginaire2) / 2; cout << "La somme des deux nombres est : " << somme_reelle << "+" << somme_imaginaire << "*i" << endl; cout << "Le produit des deux nombres est : " << produit_reelle << "+" << produit_imaginaire << "*i" << endl; cout << "La moyenne des deux nombres est : " << moyenne_reelle << "+" << moyenne_imaginaire << "*i" << endl; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter