[Tutor] Need help with one problem.
Alan Gauld
alan.gauld at yahoo.co.uk
Wed Feb 15 17:59:45 EST 2017
On 15/02/17 18:00, Adam Howlett wrote:
> Write an if-else statement that
> assigns 20 to the variable y if the variable x is greater than 100.
> Otherwise, it should assign 0 to the variable y.
>
> Is there an easy way to solve this problem?
Yes, just do what it says.
Maybe if I reword the problem slightly it will
be easier to see?
if the variable x is greater than 100,
assign 20 to the variable y,
else
assign 0 to the variable y.
Does that help?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list