# Chapter 08 : Function Prototypes¶

## Example: 1, Page No.: 5.55¶

In :
#Program to addition of two numbers

a,b=input("Enter two numbers.. ")
c=a+b
print "Sum is ... %d"%(c)


Enter two numbers.. 10,20
Sum is ... 30


## Example: 2, Page No.:5.56¶

In :
#Program to print addition, subtraction and multiplication values

a=10
b=5
print "The Addition of given value: ",a+b

def sub():
a=10
b=5
print "The Subtraction of given value:",a-b

def mul():
a=10
b=5
print "The Multiplication of given value:",a*b

sub()
mul()

The Addition of given value:  15
The Subtraction of given value: 5
The Multiplication of given value: 50


## Example: 1, page No. 5.57¶

In :
#Program for addition of two numbers

z= x+y
print "Sum is:", z

#Main Function
a, b = input("Enter two Values: ")


Enter two Values: 10,20
Sum is: 30


## Example: 2, page no. 5.58¶

In :
def date(x,y,z):
print "Employee Joined date is:%d/%d/%d" %(x,y,z)

print "Enter the employee joining date."

dd,mm,yy=eval(raw_input("Enter date, month, year: "))

date(dd,mm,yy)

Enter the employee joining date.
Enter date, month, year: 11,12,1981
Employee Joined date is:11/12/1981


## Example: 1, page no.5.59¶

In :
#Program for addition of two numbers

z=0
z=x+y
return z

#Main Function
a,b=input("Enter the a and b value:")
print "Result is:",c

Enter the a and b value:10,20
Result is: 30


## Example: 2, Page No.:5.60¶

In :
#Program to send and receives the values from function

def mul(m,n):
return (m*n)

m=n=sum=0
m,n=input("Enter two values:")
sum=mul(m,n)

print "Multiplication of the entered Values:",sum

Enter two values:30,4
Multiplication of the entered Values: 120


## Example: 1, PageNo.:5.61¶

In :
#Program for addition of two numbers

a=b=c=0
a,b=input("Enter the Values of a and b:")
c=a+b
return(c)

print "The Output of given Values:",c


Enter the Values of a and b:10,20
The Output of given Values: 30


## Example: 2, Page No. 5.62¶

In :
#Program to multiply three numbers using function

def mul():
a,b,c=input("Enter the three values for Multiplication: ")
i=a*b*c
return(i)

s=mul()
print "Multiplication of three numbers is= ",s


Enter the three values for Multiplication: 4,8,2
Multiplication of three numbers is=  64