Answers for "sum of first 50 natural numbers"

C++
0

sum of first 100 natural numbers

#include<iostream>
using namespace std;
int main(){
int i = 0;
int sum = 0;
int n = 100;
while(i<=n){
    sum = sum + i;
    i++;
}
cout << sum;
return 0;
}
Posted by: Guest on November-25-2021

Code answers related to "sum of first 50 natural numbers"

Browse Popular Code Answers by Language