## Recommended Posts

So im having a problem at highschool, we have to complete an assignment - make programs for our exercises. The problem is our professor didnt quite explain how everything works with the For and If statement together.

I have 3 exercises, ill write down the instructions for them and i would appreciate if anyone could help me out.

1st exercise:

Write a program: Program allows you to input 20 numbers, then it shows the sum of numbers that were able to be divided by number 3 (not counting numbers such as 0.9 etc., only full numbers like 3,6,9 etc.)

2nd exercise:

Write a program: Out of X (undenefined number) numbers, write down how many out of there are bigger then number 50

3rd exercise:

Write a program: Write a program, that will calculate the between number a and number b

----------------------------------------------------------------------------------------------------------------------------------

All of those exercises have to use only FOR and IF

Thanks for the reply anyone that can help  would mean a lot

##### Share on other sites
• Moderators

@MrObvious welcome to the forum. In answer to your question:

• 1st Exercise - Look at For...To...Step,,,Next in the help file. The example shows you how to iterate through a count of x numbers. Then look at Mod to do your division.
• 2nd Exercise - Look at Operators in the help file. You can use a For Loop to iterate through the list of numbers and use the Greater Than or Less Than operator to compare them to 50
• 3rd Exercise - Look at Operators in the help file for this as well. The examples show how simple Math calculations can be with AutoIt.

Good luck on your project. Try these out for yourself, and ask questions if you get stuck.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...