Yeah, thanks ne555 for the update, I do try in Borland C++ and Visual Studio 2010 C++, only Visual can use that library to fixed the problem but not in Borland C++, I have replied it here
http://www.cplusplus.com/forum/beginner/61691/ (So I think it's actually needed is it?)
You can use andornot as operators.
Is that u mean this?
and
=
&&
or
=
||
not
=
!
So just use the left one also correct? or u actually means that I can use in the above program here
while (mark<0||mark>100);
?
====================================================================
Thanks Matri X, I used to try that code before, but for this program, I want to get the output
Your mark for test 1 is bla bla bla |
if and only if the mark insert is between 0 and 100 but the program will be repeated to ask for the user input if and only if the mark insert is out of that range...
====================================================================
Thanks wolfgang, actually I'm trying to use
&&
inside while loop but my system cannot really satisfied the condition where the system will give output no matter I give input out of range or inside the range...can u help me check? Thanks...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iostream>
#include <conio>
int main()
{
int mark;
cout<<"\nEnter marks for test 1:";
cin>>mark;
while (mark<=100&&mark>0) {
cout<<"\nYour mark for test 1 is "<<mark;
break;
}
cout<<"\nYour mark for test 1 is "<<mark;
cout<<"\n\nEnd Of Program";
getch();
return 0;
}
|