Our objective is to make a program that tells the user to input multiple numbers unless the user input 0, if the user inputs zero then the program will terminate, i already have the code but it seems there is an error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include<iostream>
usingnamespace std;
int main()
{
int num[0];
for(int i=0; ;i++)
{
cout << "Enter a number: ";
cin >> num[i];
if(num[i] == 0)
break;
}
system("pause");
}
Yes,thats probably a good way to run virus programs in your computer.
And if it helps in any way,I will remember that.
Thnx mutexe for showing the article (^_^).