0
i have some project that ask me to write a program that will ask the user to input n positive number.
the program will terminate if one of those number is not positive.since i'm new,i don't have any idea>.<
5 odpowiedzi
+ 2
pseudo:
int foo;
do{
foo = input();
if(foo < 0)
break;
}while(true);
+ 1
int n;
int num;
int termination = 0;
cout << "how many numbers do you want to enter?";
cin >> n;
for(n; n > 0; n--)
{
cout << "enter nunber";
cin >> num;
if(num < 0)
{
termination = 1;
n = 0;
}
}
0
what does foo stand for?
0
my coding was failure
0
> what does foo stand for?
https://en.m.wikipedia.org/wiki/Metasyntactic_variable