Write a program to display sum of first 20 odd numbers using for loop in c++
please answer fast!!
Answers
Answered by
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
Hindi,
22 hours ago
Business Studies,
22 hours ago
English,
22 hours ago
English,
7 months ago
Social Sciences,
7 months ago
Computer Science,
7 months ago