Computer Science, asked by adhithinair, 1 day ago

Write a program to display sum of first 20 odd numbers using for loop in c++
please answer fast!!

Answers

Answered by protahet
1

*answer*

Method 1 :

#include <iostream>

using namespace std;

int main() {

int a=2,s; //we know 2 is the smallest even number.

while(a<=30) { s+=a; a+=2; }

cout<<s;

return 0;

}

Explanation:

Hope it helped plaease mark me brainliest

Similar questions