Go Programming Basics
Practice problems and improve your skills.
THEORY
All theory for this topic
# Go Programming Basics
Go programs start in `package main` and execute from `func main()`. The `fmt` package is commonly used for console input and output: `fmt.Scan` reads whitespace-separated values and `fmt.Println` prints a result followed by a newline. Go is statically typed, so a variable has a definite type such as `int`, `int64`, `float64`, `string`, or `bool`. Short declaration `:=` creates local variables when their types can be inferred.
Arithmetic operators include `+`, `-`, `*`, `/`, and `%`. Integer division discards the fractional part, while division of `float64` values keeps it. Comparisons (`==`, `!=`, `<`, `<=`, `>`, `>=`) produce a boolean. Conditions are written with `if`, `else if`, and `else`; parentheses around the condition are not required. Logical operators are `&&`, `||`, and `!`.
When solving beginner tasks, separate input, computation, and output. Read exactly the values described by the statement, store intermediate results in clearly named variables, and print only the required answer. Pay special attention to integer versus floating-point arithmetic and to boundary cases in conditions.
YOUR PROGRESS
Topic progress
PRACTICE
Problems
Solve problems from easy to hard and build your skills step by step.
Calculator β Add a Constant 2
Budget β Subtract a Constant 3
Distance β Multiply by a Constant 4
Temperature β Integer Quotient 5
Clock β Remainder 6
Access β Add a Constant 7
Shop β Subtract a Constant 8
Calendar β Multiply by a Constant 9
Game β Integer Quotient 10
Assistant β Remainder 11
Calculator β Sum of Two Numbers
Budget β Difference of Two Numbers
Distance β Product of Two Numbers
Temperature β Remainder of Two Numbers
Clock β Integer Quotient of Two Numbers
Access β Sum of Two Numbers After Shift
Shop β Difference of Two Numbers After Shift
Calendar β Product of Two Numbers After Shift
Game β Remainder of Two Numbers After Shift
Assistant β Integer Quotient of Two Numbers After Shift
Calculator β Rectangle Perimeter
Budget β Rectangle Area
Distance β Seconds to Minutes
Temperature β Minutes to Seconds
Clock β Celsius to Fahrenheit
Access β Average of Three Integers
Shop β Price for Quantity
Calendar β Distance from Speed and Time
Game β Square Perimeter
Assistant β Three-digit Digit Sum
Calculator β Maximum of Two
Budget β Minimum of Two
Distance β Are Equal
Temperature β Are Different
Clock β First Greater
Access β First Not Smaller
Shop β First Less
Calendar β First Not Greater
Game β Same Sign
Assistant β Opposite Signs
Calculator β Divisible by 2 and Greater than 6
Budget β Inside Interval [-7, 7]
Distance β Outside Interval [2, 8]
Temperature β if Conditions β Positive Multiple of 5
Clock β if Conditions β Last Digit Equals 4
Access β if Conditions β Divisible by 2 and Greater than 11
Shop β if Conditions β Inside Interval [-12, 12]
Calendar β Outside Interval [7, 13]
Positive Even Outside Interval β Rule 150
Assistant β if Conditions β Last Digit Equals 9
Calculator β Divisible by 2 and Greater than 7
Budget β Inside Interval [-8, 8]
Distance β Outside Interval [2, 9]
Positive Even Outside Interval β Rule 155
Two-digit Multiple of 7 β Rule 156
Access β Divisible by 2 and Greater than 12
Shop β Inside Interval [-13, 13]
Calendar β Outside Interval [7, 14]
Last Two Digits Divisible by 4 β Rule 160
Exactly One Condition β Rule 161
Calculator β Divisible by 2 and Greater than 8
Budget β Inside Interval [-9, 9]
Distance β Outside Interval [2, 10]
Positive Even Outside Interval β Rule 165
Two-digit Multiple of 7 β Rule 166
Access β Divisible by 2 and Greater than 13
Shop β Inside Interval [-14, 14]
Calendar β Outside Interval [7, 15]
Last Two Digits Divisible by 4 β Rule 170
Exactly One Condition β Rule 171
Calculator β Divisible by 2 and Greater than 9
Budget β Inside Interval [-10, 10]
Distance β Outside Interval [2, 11]
Positive Even Outside Interval β Rule 175
Two-digit Multiple of 7 β Rule 176
Access β Divisible by 2 and Greater than 14
Shop β Inside Interval [-15, 15]
Calendar β Outside Interval [7, 16]
Last Two Digits Divisible by 4 β Rule 180
Exactly One Condition β Rule 181
Calculator β Divisible by 2 and Greater than 10
Budget β Inside Interval [-11, 11]
Distance β Outside Interval [2, 12]
Positive Even Outside Interval β Rule 185
Two-digit Multiple of 7 β Rule 186
Access β Divisible by 2 and Greater than 15
Shop β Inside Interval [-16, 16]
Calendar β Outside Interval [7, 17]
Last Two Digits Divisible by 4 β Rule 190
Exactly One Condition β Rule 191
Positive Even Outside Interval β Rule 192
Two-digit Multiple of 7 β Rule 193
Distance β Outside Interval [2, 13]
Last Two Digits Divisible by 4 β Rule 195
Exactly One Condition β Rule 196
Access β Divisible by 2 and Greater than 16
Shop β Inside Interval [-17, 17]
Calendar β Outside Interval [7, 18]
Ticket Range and Parity β Rule 200
Outside Symmetric Zone β Rule 201
No matching problems
Try another filter or search query.