Different dialects of programming languages 😎

Bonjour(French), Hola(Spanish), Guten tag(German),  Namaste(Hindi), Vanakam(Tamil)


Cool, it's just hello in different languages....

When natural languages helps to communicate with humans, programming languages does with machines. 

Just as how grammer is inevitable for human language, so is syntax for a programming language.

Lets see the difference in the syntax of input/output statements in some high level programming languages.



JAVA

import java io.*;
class Add
{
public static void main(String args[])throws IOException
{
int a,b;
int sum=0;
System.out.println("Enter two numbers ");
BufferedReader obj= new BufferedReader(new InputStreamReader(System.in));
a= Interger.parseInt(obj.readLine());
b=Interger.parseInt(obj.readLine());
sum=a+b;
System.out.println("Sum of"+a+"and"+b+"is"+sum);
}}


PYTHON

a= int(input("Enter first number"))
b= int(input("Enter second number"))
sum=a+b
print("sum="+sum)


C

#include<studio.h>
void main()
{
int a,b;
int sum=0;
printf("Enter two numbers\n ");
scanf("%d %d",&a,&b);
printf("The sum of %d and %d is %d"a,b,sum);
}


C++

#include<iostream>
void main()
{
int a,b;
int sum=0;
cout<<"enter two numbers \n";
cin>>a>>b;
sum=a+b;
cout<<"The sum is"<<sum;
}

Comments

Post a Comment

Popular Posts