answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Would you write c plus plus program using function for logarithm of number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How can a called function determine the number of arguments that have been passed to it?

It is not the function but the compiler or interpreter which interprets the code. When the program is compiled and run the compiler checks the entire code line by line to check which function is called. If you encounter polymorphism in other Object Oriented Languages it would be more clear how a function with same name and different arguments are called.


Does javascript support recursive functions?

Yes, but a recursive function running for a long time would eventually cause your program to crash.


What is a recursive function?

A recursive function is one that calls upon itself until a given result in the original call is met. Take a look at this example. Program Recursion; Uses crt; Var number:longint; Function Factorial(number:longint):longint; Begin if number > 0 then factorial:=number*factorial(number-1) else factorial:=1; End; Begin clrscr; readln(number); writeln(factorial(number)); readln; End. Note how the function factorial calls itself.


Difference Main functions and user defined functions?

main function in C programming language and almost in every other main language is the main function that launched after the program starts. It takes two arguments, pointer to the first element of a pointers array (arguments) and number of arguments.If you would write your own functions and link by telling the entry point to your program you would not be able to get arguments any more. There are some code running before actually main function is launched. That code prepares the argument data for main function.But it is possible to change main function to your defined function, but that would require more knowledge of how linker (ld) and for example objcopy utility works.Note: There might be a difference in GNU and Microsoft C/C++ versions.


The command used to execute a BASIC programme?

Assuming a BASIC program is loaded into memory, the correct command to execute a BASIC program is: RUN. If you would like to start your program at a particular point in the execution, you may use RUN [#], where [#] is the line number you would like to start execution at.

Related questions

Show me the meaning of LN?

LN is typically the syntax used to represent the natural logarithm function. Although some programming languages and computer applications use LOG to represent this function, most calculators and math textbooks use LN. In use, it would look like this:y=ln(x)Which reads as "y equals the natural logarithm of x".The natural logarithm is a logarithm that has a base of e, Euler's number, which is a mathematical constant represented by a lowercase italic e (similar to how pi is a constant represented by a symbol). Euler's number is approximately equal to 2.718281, although it continues on far past six decimal places.Functionally, the natural logarithm can be used to solve exponential equations and is very useful in differentiating functions that are raised to another function. Typically, when the solution to an equation calls for the trivial use of a logarithm (that is the logarithm is only being used as a tool to rewrite the equation), either the natural logarithm or the common logarithm (base 10) is used.


How many primes are there less than 2 million?

You may find the exact number somewhere else, but a rough approximation is that up to a number "n", about one of every ln(n) numbers is a prime number. ln() is the natural logarithm (logarithm to the base "e"); in this case, for numbers up to 2 million, you would expect approximate one out of every 14 numbers to be a prime. More information in the Wikipedia article on "prime counting function".


What is the logarithm of 100?

logarithm of 100 = 2. If there is not a subscript number on your log, you assume it to be 10. In other words, the little subscript would be the base if you were raising it to a power, and the big number is the answer of the power. For example, log (base 10) 100 = 2 because 10 (the base) raised to a power of 2 (the log answer) = 100 (the number you just took the log of.)


How do you call an external function or program that is written in different programming language?

It doesn't matter what language the external program or function was written in since all executables must be converted to machine code. To execute an external function, that function must reside in a library to which your program is linked and you must know the prototype of the function you intend to call. This is usually found in the library header file which can simply be included in your program. You can then call the external function just as you would an internal function. To execute a specific function in another program, however, you must use the command line interface for that program.


What does log2x2 equal?

Since you did not provide a base for your logarithm there is no particular solution. In most cases it is best to assume it is to the base 10. So the answer would be: log(2*2)=log4 (to the base 10) log4=0.60205.... It is good practice to list the base to which the logarithm is at - normally written as a subscript in the lower right hand corner of the 'log'. The only exception is when the logarithm is to the base e, in which case we write it as ln(x) - where x is a real number. For more information check http://en.wikipedia.org/wiki/Logarithm


Write each number as a power of ten 3000 30000 50 50 million.?

As an example, the power you would have to raise 10 to for the result to equal 3,000 is simple the common logarithm (i.e., the logarithm base 10) of the number 3,000. (I don't happen to have with me at the moment either a logarithm table or a calculator that has a common logarithm button on it, so I can't at the moment tell you what the logarithm of 3,000 is. But that's how you'd find out what power to raise 10 to if you wanted the result to equal 3,000 . . . or any of the other numbers in the question.) Simpler example: Write 1,000 as a power of 10. Answer: The common logarithm of the number 1,000 is: 3. So 10 to the power 3 will equal 1,000. By the way, the common logarithm of 10,000 is: 4. (So 10 to the power 4 will equal 10,000.) -- So what, you ask? Well, 3,000 is between 1,000 and 10,000. So the information in the "Simpler example" in the paragraph immediately foregoing and the information in the present paragraph together imply that the common logarithm of 3,000 must be between 3 and 4 . So the power you have to raise 10 to if you want the result to equal 3,000 is 3 plus some fraction.


How can a called function determine the number of arguments that have been passed to it?

It is not the function but the compiler or interpreter which interprets the code. When the program is compiled and run the compiler checks the entire code line by line to check which function is called. If you encounter polymorphism in other Object Oriented Languages it would be more clear how a function with same name and different arguments are called.


What c code would allow the c library that includes the log function to be used in a program?

01


What is time complexity of an algorithm?

Time complexity is a function which value depend on the input and algorithm of a program and give us idea about how long it would take to execute the program


What call number would lead to a book on the function of the brain.?

500


How would you explain functions in c?

FUNCTION IN C IS DEFINED AS THE METHOD WHICH IS USED TO SOLVE THE COMPUTATIONAL PROBLEM. AND THE FUNCTON CAN BE CALLED IN ANYWHERE IN THE PROGRAM MODULE. STEPS TO DECLERE THE FUNCTION 1.FUNCTION PROTOTYPE 2.FUNCTION DECLARETEION 3.FUNCTION DEFINATION 4.FUNCTION CALL 5.FUNCTION RETUN.


What would the function MODE in Excel tell us?

The MODE function finds the most commonly occurring number in a range of numbers.