|
glennPattonWork3 wrote: Could I do with an if... if(( i < 0) && (i >100)) I'm afraid that test will never be true. No value of i can be less than zero AND greater than 100 at the same time.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It could, if it was val not i as I typed. Solved
|
|
|
|
|
According to that code as written, any value that is not 0, 50 or 100, will go to the default statement. If that is not happening then there must be some other code that we can't see.
|
|
|
|
|
That was the thing. Typing it out made me see it.
|
|
|
|
|
... oops (wrong forum red-flag-accessed-by-moi)
For some reason I thought I was in the Lounge and have disappropriated some points that shouldn't be mine. Sorry!
Is "What do I do now" an appropriate C/C++/MFC question?
Thanks (answered myself),
|
|
|
|
|
It was a need to think carefully, code blindness issue. I knew if I posted it the lounge I would get cruified by all and sundry needed somewhere to write think and take notice of the abortion I has created.
|
|
|
|
|
I am a dummy, I should have seen the problem, in fact I did as I was writing the question. I helps writing out the problem to see it more clearly, You can see the light starting to dawn in the last sentance problem solved.
|
|
|
|
|
Boolean gates are not type of transistor but rather cluster of transistors. Is that so? For example the schematic representation of the Not gate has just one line in one line out. A transistor means there is a high voltage line in high voltage line out, low voltage line in low voltage line out. Is the schematic representation showing only the relevant ins and outs?
|
|
|
|
|
Well, I mean, it might be relays or something else other than transistors, but essentially correct.
|
|
|
|
|
|
|
Thanks
Use “APM” in the Lounge search box to find my APM related AI post
|
|
|
|
|
You are welcome.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
|
Message Removed
modified 21-Jun-23 5:19am.
|
|
|
|
|
Message Removed
modified 21-Jun-23 5:19am.
|
|
|
|
|
(20*23) + (25*28) + (30*33) + (35*38) +...........+ (m*(m-3)) what is the c programmimg code of the summetion of this series
|
|
|
|
|
What have you tried? Can you write the code for evaluating a single term?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
You can see the sequence, which uses m*(m+3) not minus:
1. Set m = 20
2. Multiply m by (m + 3)
3. Add the result to the running total
4. Add 5 to m
5. Goto 2.
|
|
|
|
|
M=23 uses (m*(m-3)) or ((m-3)*m)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
If m is the first operand, as in (20 * 23) then the formula is m*(m+3) . Why would you read it the other way round, or am I missing something mathematical?
|
|
|
|
|
You substituted (M*(M+3)) for (M*(m-3)).
I'm simply reading what the OP "posted".
I'm the one that's missing something regarding you changing it.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I did not substitute, I corrected. It's pretty obvious that the questioner made a mistake and typed the wrong sign.
|
|
|
|
|
|
That is just a copy of the original question. What is your point?
|
|
|
|