MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main5

Function main5

Lab_03/Sum1.cpp:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <iostream>
6using namespace std;
7int main5() {
8 int n;
9 float sum = 0;
10 cout << "Enter the value of n: ";
11 cin >> n;
12 for (int i = 1;i <= n;i++)
13 sum += 1 / i;
14 cout << "Sum is : " << sum << endl;
15 system("pause");
16 return 0;
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected