Best first codes explained in JavaScript, Java & C++ for beginners

Every single programming language has its way of beginning or writing the first code. It is exciting to dive into them individually to discover the greatest explorations. In this practical article, you will learn about the first best codes for the 3 languages, such as JavaScript, Java and C++.

USING CODE EDITOR

JAVASCRIPT

1   console.log("Learning to code and build programs in JavaScript for the first time");

2   Press the enter key after the first line of code has been fed

3   Go to the three dots up there, located in the right-hand corner of the CODE EDITOR

4   Tap on it

5   From the drop-down list or menu, select and tap on EXECUTE

6   Choose or make an option concerning the language you want to compile in, in this case, we will have to select JAVASCRIPT

7   Automatically, the compiler will also be selected

8   Tap on RUN or EXECUTE

9   Wait till the program gives you the output

NOTE:

You will never get the output correctly when the wrong command is fed. Example, in step 1.

 

RUNNING FIRST CODE IN JAVA

JAVA

1   Load the CODE EDITOR and perform the below steps

2           public class Main {

3                     public static void main(String[ ] args) {

4                              Sysem.out.println("Learning to code and build programs in Java for the first time");

5                                     }

6              }

 

HOW TO RUN THE CODE 

  1. Click on the execute button from the main menu
  2. Select the language, that is Java
  3. Make sure you select the compiler if not selected
  4. Click finally on Execute again or Run

 

C++ – First Code

1   #include<stdio.h>

2            int main ( ) {

3                     printf("Learning to code and build programs in C++/C for the first time")

4                            return 0;

5   }

 

HOW TO RUN THE CODE

  1. From the main menu, click on the execute button in CODE EDITOR
  2. Select C++ as the language
  3. Automatically, the compiler will be selected
  4. Click on Run again

Congratulations!!!

Related posts:

About Author


Discover more from SURFCLOUD TECHNOLOGY

Subscribe to get the latest posts sent to your email.

Leave a Reply

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

Discover more from SURFCLOUD TECHNOLOGY

Subscribe now to keep reading and get access to the full archive.

Continue reading