missing codes

Nov 24, 2014 at 5:08am
what em I missing?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

int main ()
{
Int tol = 0, 
indx = 1;

while (indx <= 30)

{

tol += indx;

++indx:

return 0;
}
Last edited on Nov 24, 2014 at 6:01am
Nov 24, 2014 at 6:33am
a closing bracket after line 15 i believe
Nov 24, 2014 at 8:29am
Skimmer001 is right. I believe the proper code would be :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

int main ()
{
   int tol = 0, indx = 1;

   while (indx <= 30)

   {

      tol += indx;

      ++indx;
   }

   return 0;
}
Nov 24, 2014 at 12:55pm
so its giving me a value of zero is that correct? im not very sure if Im doing it right
Nov 24, 2014 at 4:24pm
It isn't outputting anything. Add cout << tol << '\n'; at line 16.
Topic archived. No new replies allowed.