- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Hello World program in Kotlin
In this article, we will understand how to print hello world in Kotlin. Hello world is stored as a string format and is printed using ‘print()’ function.
Input
Suppose our input is
Hello World
Output
The expected out should be
Hello World
Algorithm
Step 1 − START
Step 2 − Define a string variable
Step 3 − Display the string on the console
Step 4 − STOP
Example 1
In this example, we will simply display a string “Hello World” using the print() method in Kotlin −
fun main() { val inputStr = "Hello World!" print(inputStr) }
Output
Hello World!
Example 2
Here, we have created a custom function and printed Hello World
fun printStr(inputStr : String){ print(inputStr) } fun main() { val inputStr = "Hello World!" printStr(inputStr) }
Output
Hello World!
- Related Articles
- Hello World Program in Java
- C++ "Hello, World!" Program
- Creating Java Hello World Program
- Analysis of Java "Hello World" Program
- Python Program to Print Hello world
- Haskell Program to print Hello World!
- Swift program to print Hello World!
- How to write "Hello, World!" program in JavaScript?
- How to write "Hello World" Program in C++?
- Internal Analysis of Java "Hello World" Program
- Hello World in Dart Programming
- A closer look at Java "Hello World" program
- Hello World using Perl.
- Write a program to display "Hello World" in react native?
- First Hello World project in Arduino

Advertisements