Friday, September 1, 2023

Summation of 10 numbers

 #include <iostream>

using namespace std;

int main() {

double s,a;

s=0;

for(int i=1;i<=10;i++)

{

cout <<"a"<<i<<"=";

cin >>a;

s=s+a;

}

cout <<"The sum is "<<s;

    return 0;

}

No comments:

Post a Comment

NaCl.xyz Generator with Interactive 3D Visualization

NaCl.xyz Generator with Interactive 3D Visualization NaCl.xyz Generator with Interactive 3D Visualization ...