Q12: Write a program t to find the Y. 3 6. 6. 30 1. 70 63 56 7
Objective: This program would find the sum of the given series and print the value of Y.
Programming language: Since no programming language is mentioned, C++ is used here.
Answer:
Source Code:
/* C++ program to compute series sum */
#include <iostream>
using namespace std;
int main()
{
//variable declaration
int counter,div_val=70;
double val_of_y=0,cur_term=0;
//loop for tracking the terms in the series
for(counter=1;counter<=10;counter++)
{
//stores the current item
cur_term = double(3*counter)/double(div_val);
//stores sum
val_of_y += cur_term;
//print the current term
cout << "\n Term is: " << (3*counter) << "/" << div_val;
div_val -= 7;
}
//print the final result
cout<<"\nResult is = "<<val_of_y;
return 0;
}
Step by step
Solved in 3 steps with 1 images