#Need help with this basic exercise

31 messages · Page 1 of 1 (latest)

civic wasp
#

I am just a beginner and I am struggling with this exercise

hollow lichenBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

civic wasp
#

user needs to type 2 numbers and

#

and it should print the sum of the even numbers between those 2 numbers

#

How can i take the numbers between those 2 numbers i have an idea about the sum of the even numbers but i am struggling with taking the numbers between those 2 numbers

crude kestrel
#

what do you have so far?

civic wasp
#

nothing just the scanf

#

i dont know how to take the numbers between those 2 numbers that user inputs

crude kestrel
#

what have you tried?

civic wasp
#

havent tried nothing cuz i have no idea how to do it

#

anything*

crude kestrel
#

how would you normally go through a range of numbers?

#

say, from 0 to 10

civic wasp
#

for loop

crude kestrel
#

why not try that

civic wasp
#

okay lets say number1 is a

#

number2 is b

crude kestrel
#

number1 and number2 are already perfectly fine variable names

civic wasp
#

okay

crude kestrel
#

much more descriptive than a and b

civic wasp
#

and then

#

for number1 ?

#

or no

#

i have to add statement for number1<number2

#

?

crude kestrel
#

try it on your own, and come back if it doesn't work

civic wasp
#

okay

gray loom
#

i haven't seen someone this new to programming in a long time

#

it's interesting

#

it reminds me of the people in my freshman intro programming class in college

civic wasp
#

!close