answersLogoWhite

0

Nothing special... here is an example:

unsigned power (unsigned a, unsigned b)

{

if (b==0) return 1;

else return power (a, b-1) * a;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

How do methods and functions differ?

A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.


What are the three required sets of statements for every function that a programmer writes in C plus plus?

There is no requirement for any statement in a C++ function, let alone three sets of statements. For instance, the following is a perfectly valid function: void foo(){} Clearly this does nothing as it has no statements in the function body, but it is nevertheless a valid function. Perhaps you mean something else by "statements". The only requirement of a function is that it have a return type, a valid name, an argument list and a function body. The return type may be void, of course, and the argument list may be empty, but it must include the ellipses. The function declaration need not include the function body, and the argument list need only specify the type of argument (the argument names are optional and need not match those declared in the actual definition). The function name and the arguments define the function signature (the prototype), thus the three required "components" of a function are the return type, the signature and the function body.


Difference between user defined function or standard c library?

satandard fuction is pre define fuction like getch(),clrscr(), in c++ and userdefine fuction is self created by use to do a particular work ex of use definefuction int add(int a,int b) { int c; c=a+b; return(c); };


How do you Count node left and Right for binary tree using PHP Codeigniter?

To count the number of left and right nodes in a binary tree using PHP Codeigniter, you would typically need to traverse the tree recursively. You can create a function that takes the root node of the binary tree as a parameter and recursively counts the left and right nodes. Within the function, you would check if the current node has a left child and recursively call the function on the left child while incrementing the left count. Similarly, you would do the same for the right child. Finally, you would return the counts of left and right nodes.


What is built-in function in c?

There are no built-in functions in C++. The definition of a built-in function is a function that does not need to be declared before it is used, but every function in C++ is user-defined and must be declared before it can be used. This includes functions provided by the C++ standard library which we declare by including the appropriate headers.Some articles mistakenly describe keywords such as while, switch and if as being built-in functions, however these are statements, not functions.C++ does provide several built-in operators, some of which look and behave very much like functions. For example, the built-in sizeof() operator can be used without any declaration and looks very much like a function, but its argument is not a value, it is a type name, and we cannot (easily) define a function that accepts a type name as an argument.The built-in typeid() operator also takes a type name argument, but it is often mistakenly regarded as being a user-defined function because we must include the C++ standard library header in order to use it. But that header is only required because the return value is a std::typeinfo object which is not a built-in data type.Unlike sizeof() and typeid(), the default global new and delete operators can be overridden with user-defined function operators, thus these are also mistakenly regarded as being built-in functions. However, only the overrides are functions because that's the only way to define an operator overload; the default global operators are built-in operators, not built-in functions.The semantic difference between a built-in operator and a built-in function may seem insignificant, however a real built-in function would be no different to a user-defined function other than the fact that it need not be declared before using it. But a user-defined function also has identity (a memory address) and we can pass that identity to other functions using a function pointer argument. But we cannot pass a built-in operator to a user-defined function because it has no identity, thus it cannot be regarded as being a built-in function.

Related Questions

How do methods and functions differ?

A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.


What is the value of f(x) when the x 6?

f(x) is a function that somehow depends on "x". Since it can be anything, you need more information - specifically, you need to know how the function is defined.


What are the three required sets of statements for every function that a programmer writes in C plus plus?

There is no requirement for any statement in a C++ function, let alone three sets of statements. For instance, the following is a perfectly valid function: void foo(){} Clearly this does nothing as it has no statements in the function body, but it is nevertheless a valid function. Perhaps you mean something else by "statements". The only requirement of a function is that it have a return type, a valid name, an argument list and a function body. The return type may be void, of course, and the argument list may be empty, but it must include the ellipses. The function declaration need not include the function body, and the argument list need only specify the type of argument (the argument names are optional and need not match those declared in the actual definition). The function name and the arguments define the function signature (the prototype), thus the three required "components" of a function are the return type, the signature and the function body.


If an original expression is defined for all values of x you do not need to specify the absolute value in the simplified expression.?

The assertion is not true. Consider the function f(x) =|x - 3|, which is the distance of x from the point 3. The function is defined for all x but the absolute value is required.


What kind of symmetry indicates that a function will not have an inverse?

If a function is even ie if f(-x) = f(x). Such a function would be symmetric about the y-axis. So f(x) is a many-to-one function. The inverse mapping then is one-to-many which is not a function. In fact, the function need not be symmetric about the y-axis. Symmetry about x=k (for any constant k) would also do. Also, leaving aside the question of symmetry, the existence of an inverse depends on the domain over which the original function is defined. Thus, y = f(x) = x2 does not have an inverse if f is defined from the real numbers (R) to R. But if it is defined from (and to) the non-negative Reals there is an inverse - the square-root function.


What do you need to get in Germany?

you will need a valid passport


Difference between user defined function or standard c library?

satandard fuction is pre define fuction like getch(),clrscr(), in c++ and userdefine fuction is self created by use to do a particular work ex of use definefuction int add(int a,int b) { int c; c=a+b; return(c); };


Can an arithmetic sequence be odd?

An arithmetic sequence can consist of only odd numbers but it cannot be an odd function since it need not be defined for negative values of the index.


How do you Count node left and Right for binary tree using PHP Codeigniter?

To count the number of left and right nodes in a binary tree using PHP Codeigniter, you would typically need to traverse the tree recursively. You can create a function that takes the root node of the binary tree as a parameter and recursively counts the left and right nodes. Within the function, you would check if the current node has a left child and recursively call the function on the left child while incrementing the left count. Similarly, you would do the same for the right child. Finally, you would return the counts of left and right nodes.


What is the Range of great integer function Why?

There is no such thing as an interger.The ceiling function is a function which maps any variable x to the next integer, or the smallest integer greater than or equal to x. Why? Because that is how the function is defined. And there are many occasions when it is applied in normal life. If you require 3.2 cans of paint to paint a wall you will need to buy 4 cans, if a school wants to take 63 children and staff no a trip and a bus has only 30 seats, you will need three buses.


Do you need for installation of Windows XP Professional to be valid and legal you must have a user license?

Yes you do need to have a valid legal license.


Do you need to be on hotmail to be on facebook?

No, but you need to have a valid email address.