Understanding the First Swift "Hello World" Program | Swift Hello World Example

Hey beautiful people!! Welcome to a very interesting article related to Swift Programming and. If you are searching tutorial for how to write Hello World program in swift Programming Language then here you will find answers to your queries. 

swift hello world example

In this article we will discuss about how to Write Swift Hello World program. Hello World is a simple program which approx every beginner performs while learning a programming language. It simply prints Hello World on the screen. So, let's start the tutorial but before that let's take an overview of Swift programming language.

What is Swift?

Swift is one of the most used programming language of today's time. Swift programming language is an open source programming language which comes with many in-built features like platform independent, object oriented, general purpose, expressive, etc. 


Print "Hello World" program in Swift

Now, let's start our first program i.e., Print in Swift. For this just copy and paste the following code;

// Swift "Hello, World!" Program


print("Hello World!!"

Output will be as follows; 

Hello World!!

If you see such output then congrats you have executed your first program in Swift programming language successfully.

Now, let's know how this Swift Hello World program works;


How Swift Hello World program works?

Here, are the different parts of Swift Hello World program;

Swift Comment- Comment are used as hints to make a code more understandable. In swift, two slashes are used to write a comment.

// Swift "Hello, World!" Program

Print Statement- This is a print function and is used to print in the screen.

print("Hello World!!")


Conclusion

Above we have discussed tutorial for how to write Hello World program in swift programming language. Hello World is a simple program which approx every beginner performs while learning a programming language. It simply prints Hello World on the screen. By following the above mentioned steps anyone can easily write Swift Hello World program.

Related Posts

Post a Comment