missing codes

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
a closing bracket after line 15 i believe
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;
}
so its giving me a value of zero is that correct? im not very sure if Im doing it right
It isn't outputting anything. Add cout << tol << '\n'; at line 16.
Topic archived. No new replies allowed.