Python sample program

Write a Program to find sum of two numbers in C, Java and Python.

C

#include<stdio.h>

void main()

{

   int a,b;

   a=10;

   b=20;

printf("The Sum : %d",(a+b));

}

JAVA

class Addition

{

    public static void main(String args[ ])

   {

      int a,b;

      a = 10;

      b = 20;

System.out.println("The Sum : "+(a+b));

    }

}

 

PYTHON

a = 10

b = 20

print("The Sum : ",(a+b))

By observing the code of same program in different programming language we can easily make a decision that Python code will be simple and concise.


Execution of C Program

C program

Execution of Java Program

C Execution

Execution of Python Program

Java execution