(2 += 2) = ?
6
That's it. Just 6. Or does it equal something else? Does anyone not understand this? I'm trying to get people thinking. 2 += 2 | 2 = 2 + 2 | Now, does that make sense? I will state the answer in a moment. |
0 ?
|
Quote:
The answer was false. |
Oh. I had seen (2+=2) .. which isn't even a problem.
|
Quote:
Actually, in programing it is. You can use something like "variable += 1" which is the same as saying "variable = variable + 1" |
2 += 2 | 2 = 2 + 2 | OR
2 + x = 2 | 2 = 4 | x = 0 | 2 x = 0/2 x = 0 false. |
| | Imply absolute value?
|
Quote:
No, I was not implying absolute value. I was just using "|" to separate my things. |
Quote:
|
What exactly are you trying to ask?
The plus equals notation is invalid with a constant on the left. It just doesn't mean anything. |
Quote:
I already wrote the answer, "false." (2 += 2) = false |
Here's an easy one...
What is the output produced by this script? x= 1; for k= 8:-2:3 x= x+k; disp(x) end |
Quote:
disp is a BASIC language trait. Alright, this is not like a usual for statement, so I can't answer it. I also don't know BASIC language very well. |
Lol, it's MATLAB, which is the only language I can write in besides Fortran.
|
Quote:
I'm telling you right now, MATLAB is based on BASIC. As are many other languages. If you've ever messed with a TI calculator, the language used is called TI-BASIC, which is based on basic, and similar in syntax. Anyways, that's neato, I'd never heard or seen that language used before. I think I might learn it just for the fun of it. Random PHPness. PHP Code:
|
Quote:
Thank you |
do
line (20,20)-(40,40); CLR:R do loop while end keys = "" something like that? Qbasic was so much fun sophomore year. |
Quote:
Yeah, something like that. BASIC is written line by line. MATLAB is broken by semi-colons which separates it from BASIC. However, it uses the same terms by which BASIC programs are built upon. Also, just so everybody knows, BASIC is called BASIC for more than the words it stands for. It was made easy so that people could pick it up easily, but I always found it to be too loose. |
All times are GMT -6. The time now is 03:20 AM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.