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.
2. Write a Kotlin program to find out what version of Kotlin you are using.
3. Write a Kotlin program to display the current date and time.
4. Write a Kotlin program to take user input and display it.
5. Write a Kotlin program to perform addition, subtraction, multiplication and division of two numbers.
6. Write a Kotlin program to check if a given number is even or odd.
7. Write a Kotlin program to find the maximum and minimum of three numbers.
8. Write a Kotlin program to find the factorial of a given number.
9. Write a Kotlin program to check if a given year is a leap year.
10. Write a Kotlin program to calculate the area and perimeter of a circle.
11. Write a Kotlin program to convert temperature from Celsius to Fahrenheit and vice versa.
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.
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://w3resource.com/kotlin-exercises/basic/index.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics