VBA to C++

Hello, I recently did programming at school and what I thought was C was actually VBA. I tried to change the VBA to C++ but I couldn't does anybody know how to change this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Public Sub main()

Dim counter As Integer
Dim num As Integer
tot = 0


For counter = 1 To 5
num = InputBox("Please insert a number")
tot = tot + num
Next counter

MsgBox (tot)

End Sub


into C++.
Thank you in advanced.
Last edited on
int counter;
int num;

int tot = 0;

for (counter = 0; counter <=5; counter++)
{
num = 0
cout << "Insert a number: ";
cin >> num;
tot+ = num;
}

cout << tot;
Topic archived. No new replies allowed.