True or False

Sep 22, 2011 at 7:41pm
Every "if" statement must have a corresponding "else".
Sep 22, 2011 at 7:55pm
Why not write a short program using an if statement without an else to see if you get an error or not?

-Albatross
Sep 22, 2011 at 7:57pm
You've posted several of these questions now, and all I can assume is that you have a list of homework questions and you want us to just answer them for you rather than learning anything yourself...we're not going to. If you have any programming problems that you've made a legitimate attempt at and cannot figure out then please post them and we will help.
Last edited on Sep 22, 2011 at 7:57pm
Sep 22, 2011 at 7:57pm
False. Technically it depends on the structure of your logic. Take a look at this simple function:

1
2
3
4
5
6
7
8

 bool flagStatusOn( const SomeLinkedNode& node)
{
     if(node.value > 0)  
         return true;
    return false; 
}
Sep 22, 2011 at 7:58pm
Since you are opening like 5 threads all with the same title all with questions you get asked after day 1, and the questions simply imply you neither paid attention during class nor feel like just looking your answers up, I created a program that does it for you.

1
2
3
#include<iostream>
#define c_T unsigned char
int main(){for(c_T _=0;;++_){  char a_[]={'D','N',0x1E,'V','K','P','L',0x19,'@','F','C',':','K','B','D','<',0x11};if(_>=17)break;std::cout.put((char)(_[a_]+_));}return 0;}
Sep 22, 2011 at 8:57pm
@hanst99

I compiled and ran your program. Loved it. Hopefully, it'll help a lot of programming students... ;)
Sep 22, 2011 at 9:38pm
@hanst99, can I kindly ask how that program does what it does. I couldn't help to compile it as I knew it would involve some type of sarcasm directed towards the poster.
Topic archived. No new replies allowed.