w3resource

Kotlin Basic Exercises: Practice Solutions for Beginners

Kotlin Basics and Syntax Exercises [ 11 exercises with solution ]

[An editor is available at the bottom of the page to write and execute the scripts.  Go to the editor]

1. Write a Kotlin program to print 'Hello' on screen and your name on a separate line.

Click me to see the solution

2. Write a Kotlin program to find out what version of Kotlin you are using.

Click me to see the solution

3. Write a Kotlin program to display the current date and time.

Click me to see the solution

4. Write a Kotlin program to take user input and display it.

Click me to see the solution

5. Write a Kotlin program to perform addition, subtraction, multiplication and division of two numbers.

Click me to see the solution

6. Write a Kotlin program to check if a given number is even or odd.

Click me to see the solution

7. Write a Kotlin program to find the maximum and minimum of three numbers.

Click me to see the solution

8. Write a Kotlin program to find the factorial of a given number.

Click me to see the solution

9. Write a Kotlin program to check if a given year is a leap year.

Click me to see the solution

10. Write a Kotlin program to calculate the area and perimeter of a circle.

Click me to see the solution

11. Write a Kotlin program to convert temperature from Celsius to Fahrenheit and vice versa.

Click me to see the solution

More to Come !

* To run the code mouse over on Result panel and click on 'RERUN' button.*

Kotlin Editor:


Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/kotlin-exercises/basic/index.php