Open In App

Print “GeeksforGeeks” in 10 different programming languages

Improve
Improve
Like Article
Like
Save
Share
Report

The most elementary part of learning any computer programming language is the ability to print a desired text on the screen or console. Thus, the task of this article is to guide programmers new to any of the 10 different languages discussed below, i.e. GO, Fortran, Pascal, Scala, Perl, ADA, Ruby, Kotlin, Javascript and C#.

Prerequisites : The most important tool we need for a computer programming language is an integrated development environment.
Integrated Development Environment : An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger. A programmer shall write the code on the text editor and the IDE binds the program and run it on the system. Now, many organizations target to build IDEs both paid and free versions for various programming languages. These can be installed on the system and we can then run our programs onto it. Another way of running the same program is using online IDEs known as cloud IDE.
Cloud IDE : Cloud IDE is a web application where programmer writes the code, this code is then run on the server program and thus the result of the code is displayed to the user. In cloud IDEs, the browser is essentially a thin client that allows users to access a variety of Cloud-based applications and services and running program on an online machine is one of them. In the case of cloud IDEs the user only needs and active internet connection and a web browser. Online IDEs are light weighted websites and can be access from anywhere and any machine. Examples of online IDEs are Amazon Cloud9, Codeanywhere are some of the cloud IDEs which provide users pay-per-use facility. Some of the free IDEs are ideone, geeksforgeeks IDE, codechef IDE, rextester. The latter ones are used mostly for smaller programs and majorly for competitive programming purpose.

All the compilers or interpreter of the languages discussed below are available on ideone. Once we are done with setting up the integrated development environment, next comes the syntax. All languages, may it be compiled or interpreted, has a syntax.

Syntax : Syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language. The compiler or interpreter might throw some errors if at any place the syntax rules are disturbed. The syntax of the 10 languages are given below. Readers are required to open ideone’s link on a new tab, select the desired language and copy the code from here. Thus, this way reader will successfully have his doors open for a new programming language. Follow the programs below for syntax of the language.

GO

package main
import "fmt"

func main(){
    fmt.Printf("GeeksForGeeks - A computer science portal for geeks")
}

Fortran

!Compiler - gfortran 6.3

program myfirstprogram
    !Print Message
    write (*,*)'GeeksForGeeks - A computer science portal for geeks'
end

Pascal

(*Compiler - gpc20070904*)
program MyFirstProgram;
begin
  (*Print Message*)
  writeln ('GeeksForGeeks - A computer science portal for geeks')
end.

Scala

//Scala, Compiler - scala 2.12.1
object Main extends App {
       
        //Print Message
    System.out.println("GeeksForGeeks - A computer science portal for geeks");
}

Perl

#Interpreter/Compiler - perl6
#!/usr/bin/perl6
#First program in Perl
  
# Strict is recommended for new programmers
# as if there are errors use strict will 
#abort the execution if used.
use strict;

# Print a message.
print "GeeksForGeeks - A computer science portal for geeks\n";

ADA

--ADA95 or ADA compiler - gnat 6.3
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
 
procedure MyFirstProgram is
begin
    --Print Message
    Put("GeeksForGeeks - A computer science portal for geeks");
end;

Ruby

#Ruby - ruby 2.3.3

class MyFirstProgram
   def initialize(name)
      @name = name.capitalize
   end
   #Function for printing Message
   def printMessage
      puts "GeeksForGeeks - #{@name}!"
   end
end
#Creating object of a class
printmessageobject = MyFirstProgram.new("A computer science portal for geeks")
#Printing Message
printmessageobject.printMessage

Kotlin

//Kotlin 1.1

fun main(args: Array) {
    println("Hello, world!")
}

Javascript

//Javascript - rhino 1.7.7
importPackage(java.io);
importPackage(java.lang);
     
//Print Message
System.out.println("GeeksForGeeks - A computer science portal for geeks");

C#

//C# - gmcs 4.6.2
using System;
public class MyFirstProgram
{
    //Driver Function
    public static void Main()
       {
            //Print Message
           Console.WriteLine("GeeksForGeeks - A computer science portal for geeks");
       }
}

Last Updated : 26 Dec, 2017
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads