Home | | Problem Solving and Python Programming | Function Prototypes

# Function Prototypes

i. Function without arguments and without return type ii. Function with arguments and without return type iii. Function without arguments and with return type iv. Function with arguments and with return type

Function Prototypes:

i.                 Function without arguments and without return type

ii.              Function with arguments and without return type

iii.            Function without arguments and with return type

iv.            Function with arguments and with return type

### i) Function without arguments and without return type

o       In this type no argument is passed through the function call and no output is return to main function

o       The sub function will read the input values perform the operation and print the result in the same block

### ii)           Function with arguments and without return type

o       Arguments are passed through the function call but output is not return to the main function

### iii)        Function without arguments and with return type

o       In this type no argument is passed through the function call but output is return to the main function.

### iv) Function with arguments and with return type

In this type arguments are passed through the function call and output is return to the main function

## Without Return Type

### Without argument

a=int(input("enter a"))

b=int(input("enter b"))

c=a+b

print(c)

OUTPUT:

enter a 5

enter b 10

15

### With argument

c=a+b

print(c)

a=int(input("enter a"))

b=int(input("enter b"))

OUTPUT:

enter a 5

enter b 10

15

### Without argument

a=int(input("enter a"))

b=int(input("enter b"))

c=a+b

return c

print(c)

OUTPUT:

enter a 5

enter b 10

15

### With argument

c=a+b

return c

a=int(input("enter a"))

b=int(input("enter b"))

print(c)

### OUTPUT:

enter a 5

enter b 10

15

Tags : Python , Problem Solving and Python Programming : Data, Expressions, Statements
Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Problem Solving and Python Programming : Data, Expressions, Statements : Function Prototypes | Python