I am having some problems trying to compile this program can anyone help me out?
#include %26lt;iostream%26gt;
using std::cin;
int main()
{
// input range to scan values
cin %26gt;%26gt; lowerx;
cin %26gt;%26gt; upperx;
// loop over all combinations of x and y
for (int x = lowerx; x %26lt; upperx; x++)
{
for (int y = lowery; y %26lt; uppery; y++)
{
if (!(x%26lt;5)%26amp;%26amp;!(y%26gt;=7) != !((x%26lt;5)||(y%26gt;=7))) // test equivalence
{
printf("Expressions are not equivalent. x = %d, y = %d", x, y);
return;
}
}
}
printf("Expressions are equivalent over the specified range");
return;
De Morgans Law in C++?
are you retarded? Do you have Suleyman? ;)
you never declared any of your upper or lower variables
you need your returns to be return(0);
and you're missing a '}' after the last return.
Reply:Good answer! Would be best, if you didn't call him retarded, though.
Use a syntax checker that will show you on which line something is wrong. Report It
Reply:Do you have "lowery" and "uppery" defined?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment