Horje
Write a CPP program to calculate sum of first N natural numbers Code Example
Write a CPP program to calculate sum of first N natural numbers

#include <iostream>

using namespace std;

int main(){
	int N,i,sum=0;
	cin>>N;
     for(i=0;i<=N;)
     {
         sum=sum+N;
        N--;
     }
     cout<<sum;
}




Cpp

Related
how to get the numbers in a vector c++ sfml Code Example how to get the numbers in a vector c++ sfml Code Example
DSA 2. Complexity Analysis Google drive Educative excellent courses!!!! [Educative.io] Competitive Programming in C++ The Keys to Success Code Example DSA 2. Complexity Analysis Google drive Educative excellent courses!!!! [Educative.io] Competitive Programming in C++ The Keys to Success Code Example
array di struct Code Example array di struct Code Example
gcd Code Example gcd Code Example
reverse sort a vector Code Example reverse sort a vector Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9