Friday, 4 June 2021

C++ program to calculate the sum of n complex number without class

 C++ program to calculate the sum of n complex number without class





//#include <iostream>
#include<bits/stdc++.h>

using namespace std;
int main()
{
    int numilj;
    cout << "Enter how match complex number :";
    cin >> i;
    int complex[i][2], real = 0ima = 0;

    for (l = 0l < il++)
    {

        cout << "Enter the real number :";
        cin >> complex[l][1];
        cout << "Enter the imaganary number : i";
        cin >> complex[l][2];
    }
    for (l = 0l < il++)

    {
        cout << l + 1 << " number input is :" << complex[l][1<< " + i" << complex[l][2<< endl;
    }
    for (l = 0l < il++)
    {
        real += complex[l][1];
        ima += complex[l][2];
    }
    cout << "The sum of all is = " << real << "+ i" << ima;
    return 0;
}



Output:


Share:

0 comments:

Post a Comment