How to print Happy New Year in 5 different languages

How to print Happy New Year in 5 different languages

Are you interested in coding? So let us teach you how you can print “Happy New Year 2024” in five different programming languages. This is a very interesting and easy tutorial, which will make you enjoy coding. So let’s start!

Watch this video on YouTube: https://www.youtube.com/@RoyalTechAcademy

The first language is Python. Python is a very popular and simple language, which gives you the power to work in just a few lines. To print “Happy New Year 2024” in Python, you just have to write this line:

				
					print("Happy New Year 2024")

				
			

Fine, that’s it! In the output you will see “Happy New Year 2024”, interesting!

The second language is Java. Java is a very powerful and versatile language, which gives you the facility to run it on every platform. To print “Happy New Year 2024” in Java, you have to write this code:

				
					public class Main {
  public static void main(String[] args) {
    System.out.println("Happy New Year 2024");
  }
}

				
			

This code lets you define a class and a method in which you will be printing “Happy New Year 2024”. In the output, you will see “Happy New Year 2024”. Wow, what’s the matter!

The third language is C. C is a very fast and low-level language, which gives you the freedom to interact with the hardware. To print “Happy New Year 2024” in C, you have to write this code:

				
					#include <stdio.h>
int main() {
  printf("Happy New Year 2024\n");
  return 0;
}

				
			

This code includes a library, which helps you in giving your output. Then you define a main function in which you are printing “Happy New Year 2024”. In the output you will see “Happy New Year 2024”. cool!

The fourth language is Ruby. Ruby is a very expressive and elegant language, which makes it fun for you to write code. To print “Happy New Year 2024” in Ruby, you just have to write this line:

				
					puts "Happy New Year 2024"

				
			

That’s it! In the output you will see “Happy New Year 2024”. Awesome!

The fifth language is JavaScript. JavaScript is a very dynamic and interactive language, which gives you the power to add logic and animation to your web pages. To print “Happy New Year 2024” in JavaScript, you have to write this code:

				
					console.log("Happy New Year 2024");

				
			

This code prints “Happy New Year 2024” in your console. In the output you will see “Happy New Year 2024”. It’s great!

So friends, this was today’s tutorial. Hope you will like it. If you have any questions or suggestions related to coding, please do share in the comment section. If you  want to read more go to our blog page. And yes, he had very good luck this year. Code, make a new year! Thank you!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top