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

Function main6

Lab_03/Sum2.cpp:7–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected