Hi i have a problem with this program. Its not too complex, but frustrating. Here is the question......Write a complete c++ program to find the sum of first 5 odd numbers using while loop. Make sure to write an output statement to show the sum. Hint: Variable sum needs to be initialized to 0. Here is what I have so far
#include <iostream>
using namespace std;
int main ()
{
int x, b,c;
x= 1;
b=1;
c=0;
do
{
x+=2;
cout<<x<<endl;
}
while (x<=5);
{
c= c +x;
x++;
cout<<x<<endl;
system ("pause");
return 0;