Which from the following is not a maths functions

Which from the following is not a maths functions? *

a. exp()

b. time ()

c. log ()

d. pow ().

  1. What is the output of below program?
    main() {
    int a = 10;
    cout
    }

a. 11

b. 10

c. 12

d. Not defined

  1. What should be passed in parameters when function does not require any parameters? *

a. tab space

b. blank space

c. void

d. both void & blank space

The Correct Answer and Explanation is :

1. Which from the following is not a math function?

Answer: b. time()

Explanation:
Math functions typically perform mathematical operations, such as logarithms, exponentiation, or power. The options provided are:

  • exp(): A mathematical function that calculates the exponential value of a number (e^x).
  • log(): A mathematical function that computes the natural logarithm (log base e) of a number.
  • pow(): A mathematical function that returns the value of a number raised to a specified power.

However, the time() function is not a math function; it is typically used in programming (e.g., C, Python) to get the current system time or calculate the elapsed time.


2. What is the output of the below program?

main() {
    int a = 10;
    cout << a;
}

Answer: b. 10

Explanation:
In the given code snippet, a variable a is initialized with the value 10. The cout statement is used to print the value of a. Since no modification is made to a in the code, the output will simply display the value of a, which is 10.


3. What should be passed in parameters when a function does not require any parameters?

Answer: c. void

Explanation:
In programming, when defining a function, the parameter list defines what values (if any) the function expects when it is called. If a function does not require any parameters, the following options are valid:

  • void: The void keyword is used in the function definition to indicate that the function does not expect any arguments. This means the function does not require parameters to be passed when called.
  • blank space: This is not a valid choice for function parameters. An empty parameter list is represented by void in many programming languages (e.g., C, C++, Java).
  • tab space: A tab space is not used in function parameters; it is just a formatting tool to make code more readable.

The correct answer is void, because it explicitly indicates that the function does not expect parameters.

For example:

void myFunction() {
    cout << "This function does not take parameters.";
}

In this function, void indicates that myFunction() does not take any parameters when called.

Scroll to Top