Sip Posted March 29, 2002 Author Report Share Posted March 29, 2002 Ok, time for another one ... this one, you either know it or you don't! Warning: only the trully geeky ones will know the answer. In computers: What is a "nibble"? Quote Link to comment Share on other sites More sharing options...
Azat Posted March 30, 2002 Report Share Posted March 30, 2002 I know what a nybble is. I am guessing that it is the same thing. I wonder is I am a "half"(hint) geek? Quote Link to comment Share on other sites More sharing options...
Sip Posted March 30, 2002 Author Report Share Posted March 30, 2002 It is ... it is half a byte, i.e 4 bits ... you you have bit, nibble, byte, word (doublet), quadlet (32 bits) etc (octlet). So another trivial yet not so trivial question that only geeks know ... how many bytes in a mega byte? Quote Link to comment Share on other sites More sharing options...
Harut Posted March 30, 2002 Report Share Posted March 30, 2002 1,048,576 bytes!!! did i become geek already? Quote Link to comment Share on other sites More sharing options...
Sip Posted March 30, 2002 Author Report Share Posted March 30, 2002 Yes! Welcome aboard Quote Link to comment Share on other sites More sharing options...
Guest Fadi Posted March 30, 2002 Report Share Posted March 30, 2002 I will post my C++ **** Homework and I will allege it is a puzzle then wait Azat or Seaphan answer it, I will copy write my name and I will have my homework compleated. So is it a good idea ? Afterall it is also a puzzle Quote Link to comment Share on other sites More sharing options...
MosJan Posted March 31, 2002 Report Share Posted March 31, 2002 Imasdun Axer shat xelatsy a mer fedin shat Bravo Dras Quote Link to comment Share on other sites More sharing options...
Sip Posted March 31, 2002 Author Report Share Posted March 31, 2002 Sure why not Domino jan ... Azat and I will write a nice "virus" and tell you it is the solution. You will run it on your computer and it will send us all your secrets!!! Just wait a couple of weeks and they way it is going, Harut is going to be able to do all your homeworks for you Quote Link to comment Share on other sites More sharing options...
Guest Fadi Posted March 31, 2002 Report Share Posted March 31, 2002 But wait a minute, I may be dumb in computers... but sending info's, is it not the task of a trojan ? Quote Link to comment Share on other sites More sharing options...
Sip Posted April 1, 2002 Author Report Share Posted April 1, 2002 Technically yes. If it is a program that runs, pretending to do one thing but actually doing another, usually destructive thing, then it is called a Trojan Horse. A virus copies itself and sometimes mutates (changed its own program). But as far as sending information back, any one of those (virus, worm, or trojan) can send info back as far as I know... worm is basically same as a virus ... they used to be classified differently depending on how they existed and "reproduced" but I think the terms are being used interchangably now. Quote Link to comment Share on other sites More sharing options...
MosJan Posted April 7, 2002 Report Share Posted April 7, 2002 what can we use this C++ for ??? MOvses [ April 07, 2002, 01:26 AM: Message edited by: MosJan ] Quote Link to comment Share on other sites More sharing options...
Harut Posted April 7, 2002 Report Share Posted April 7, 2002 Sip jan, here is one of the answers. code: int i, n=20;for(i = 0 ; i < n ; n --) printf("-"); i changed "i" to "n" in the last part of "for". Quote Link to comment Share on other sites More sharing options...
Sip Posted April 7, 2002 Author Report Share Posted April 7, 2002 quote:Originally posted by MosJan:what can we use this C++ for ??? MOvsesAlmost every program you see running on your computer was written in C/C++. The windows/unix/linux operating systems are all written in C/C++. Even C/C++ compilers are written in C/C++!!!!!!!! (the compiler takes a C/C++ souce and makes the executable program that you can run). Harut jan, one down, 2 to go Quote Link to comment Share on other sites More sharing options...
Harut Posted April 7, 2002 Report Share Posted April 7, 2002 quote:Originally posted by Sip:Just wait a couple of weeks and they way it is going, Harut is going to be able to do all your homeworks for you smilies/lol.gifwell, if Domino behaves, i might do them. acctually, it will be benefical for me too. my prof. is quite popular person in industry (at least he says so).and he promised me very good reconmendational letter, if i do some extra work. honestly said, i liked this language very much.it is hard, but still it is charming.i've got into it so much that i pay very little attantion to my other classes. Quote Link to comment Share on other sites More sharing options...
Sip Posted April 7, 2002 Author Report Share Posted April 7, 2002 Once you get used to power of C/C++, everything else seems like a toy. In C, you have control over EVERYTHING. Read/Write anything you want from/to any part of the memory ... it also means you could really screw things up if you don't know what you are doing and if you are not carefull (well, these days, worst case your program will crash ) Quote Link to comment Share on other sites More sharing options...
Sip Posted April 7, 2002 Author Report Share Posted April 7, 2002 By the way, Harut I think you are probably ready for the following problem: C/C++ Programming ProblemPlease find three ways to change one character in the following code so that the resulting code will print 20 times - (minus sign)Remember : for each solution you can only change one character, and there are three different solutions (yes, space is one character too). code:int i, n=20;for(i = 0 ; i < n ; i --) printf("-");Basically it says you can't add or delete anything. Just "change" one character (including blanks). The output should be "--------------------" (20 minus signs). It took me a while to figure it out so it is definitely not atrick question or a joke. It makes you "think" when you see that only changing one character can have such dramatic effects ! Now go and try to debug 1 million lines of code in a real program !!! Quote Link to comment Share on other sites More sharing options...
Sip Posted April 9, 2002 Author Report Share Posted April 9, 2002 quote:Originally posted by Harut:Sip jan, here comes one more. code:int i, n=20;for(i = 0 ; i <-n ; i --) printf("-");i changed the " " (space) between "<" and "n" to "-". The third one was correct but this one I don't think will work When you start, i=0. 0<-20 is false so the loop will not execute. 2 down, 1 more to go Quote Link to comment Share on other sites More sharing options...
Guest Fadi Posted April 9, 2002 Report Share Posted April 9, 2002 Why not just ? printf(" -"); printf("- "); and printf(" - "); [ April 09, 2002, 07:43 AM: Message edited by: Domino ] Quote Link to comment Share on other sites More sharing options...
Guest Fadi Posted April 9, 2002 Report Share Posted April 9, 2002 O.K I see, my answer is wrong. "can't add or delete anything" and "--------------------" I havent paied any attention to this. [ April 09, 2002, 09:01 AM: Message edited by: Domino ] Quote Link to comment Share on other sites More sharing options...
Harut Posted April 9, 2002 Report Share Posted April 9, 2002 Sip jan, here comes one more. code:int i, n=20;for(i = 0 ; i <-n ; i --) printf("-");i changed the " " (space) between "<" and "n" to "-". Quote Link to comment Share on other sites More sharing options...
Harut Posted April 9, 2002 Report Share Posted April 9, 2002 and one more. code: int i, n=20;for(i = 0 ;-i < n ; i --) printf("-"); i changed the " " (space) between ";" and "i" to "-". Quote Link to comment Share on other sites More sharing options...
Harut Posted April 10, 2002 Report Share Posted April 10, 2002 quote:Originally posted by Sip: quote:Originally posted by Harut:Sip jan, here comes one more. code:int i, n=20;for(i = 0 ; i <-n ; i --) printf("-");i changed the " " (space) between "<" and "n" to "-". The third one was correct but this one I don't think will work When you start, i=0. 0<-20 is false so the loop will not execute. 2 down, 1 more to go and just what i was thinking when posting this? that's right, still one more to go. Quote Link to comment Share on other sites More sharing options...
Harut Posted April 25, 2002 Report Share Posted April 25, 2002 Sip, you have to give me the third solution of this, if there is any. this was the problem.code:int i, n=20;for(i = 0 ; i < n ; i --) printf("-");those are my two answers.code:int i, n=20;for(i = 0 ;-i < n ; i --) printf("-");code:int i, n=20;for(i = 0 ; i < n ; n --) printf("-");i can't find the third one. or maybe a hint. [ April 25, 2002, 05:54 PM: Message edited by: Harut ] Quote Link to comment Share on other sites More sharing options...
Sip Posted April 26, 2002 Author Report Share Posted April 26, 2002 ok hint time ... the way "for" works is: for ( expr_1 ; expr_2 ; expr_3 ) ... where expr_1, expr_2, and expr_3 are ANY C++ expression. The first one is usually an assignment to initialize, the second one is a conditional to check for loop termination and the third one is again an assignment of some sort to do the iteration. So now, THINK OUTSIDE THE BOX those expressions can be ANYTHING. Assingment, conditional, function call, arithmetic operation, etc etc ... That's as much as I can say. But this third one is pretty cool to figure out. Quote Link to comment Share on other sites More sharing options...
Harut Posted April 26, 2002 Report Share Posted April 26, 2002 I GOT IT!!!!! code:int i, n=20;for(i = 0 ; i + n ; i --) printf("-");i changed "<" to "+". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.