Last active
December 23, 2015 17:19
-
-
Save jumbojet/6667505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function that takes two integer (alredy declared as Intgers so as compiler can undertand) as input and | |
// Returns a output again of type integer | |
int add(int a , int b){ | |
// Here also variable c is declared as Integer , any other type which compiler can not convert to like | |
// will give error | |
int c = a + b | |
return c | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python Program doesn't declares the type of variables and neither it provides the return type. | |
# The way the output of the function is handled defines the type it returns | |
def add(a,b): | |
# Here also if we see variable c is not assigned any type it assumes the type of a+b | |
c = a+b | |
return c | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment