create a method from main function which accept two int type of variables a and b as parameters and evaluate the following expression as the return type float and the result will be printed back in to main functions
Answers
Js java c python ruby kisme likhna h?
A function, which can also be referred to as subroutine, procedure, subprogram or even method, carries out tasks defined by a sequence of statements called a statement blockthat need only be written once and called by a program as many times as needed to carry out the same task.
Functions may depend on variables passed to them, called arguments, and may pass results of a task on to the caller of the function, this is called the return value.
It is important to note that a function that exists in the global scope can also be called global function and a function that is defined inside a class is called a member function. (The term method is commonly used in other programming languages to refer to things like member functions, but this can lead to confusion in dealing with C++ which supports both virtual and non-virtual dispatch of member functions.)