Keyword

Result: 12 questions

What will be the output of the program?

public class SqrtExample 
{
    public static void main(String [] args) 
    {
        double value = -9.0;
        System.out.println( Math.sqrt(value));
    }
}
Quiz

What will be the output of the program?

System.out.println(Math.sqrt(-4D));

Quiz

Which header statement is missing in the given below program to get the desired output?

#include<stdio.h>
#include<math.h>

int main ()
{
   double x = 1234321;
  
   double result = sqrt(x);
  
   printf("The square root of %.2lf is %.2lf\n", x, result);
   return 0;
}

 

Quiz

What will be the output of the program?

#include<stdio.h>
#include<math.h>
int main()
{
    printf("%f\n", sqrt(36.0));
    return 0;
}
Quiz

What output will be produced by the code below?

import Foundation
let number = 16
print("\(number) squared is \(number * number), and its square root is \(sqrt(number))")

Answer: This code will not compile.

Explanation: The sqrt() function can be called using two different types of parameter, neither of which are integers. In this example, Swift's type inference will consider number to be an Integer, which cannot be used by sqrt()unless you typecast it.

View

What output will be produced by the code below?

import Foundation
let number = 16.0
print("\(number) squared is \(number * number), and its square root is \(sqrt(number))")

Answer:

Correct answer: "16.0 squared is 256.0, and its square root is 4.0".

Explanation: Using its type inference, Swift will consider number to be an Double, which will be interpolated correctly into the string even when sqrt() is called. When Doubles are interpolated into strings, they have .0 appended to their values when they have no fractional digits.

View

What output will be produced by the code below?

import Foundation
let number = 16.0
print("\(number) squared is \(number * number), and its square root is \(sqrt(number))")

Answer:

 

Correct answer: "16.0 squared is 256.0, and its square root is 4.0".

Explanation: Using its type inference, Swift will consider number to be an Double, which will be interpolated correctly into the string even when sqrt() is called. When Doubles are interpolated into strings, they have .0 appended to their values when they have no fractional digits.

View

What would be the output of the following code ?

> sqrt(-17)

 

Quiz
for(j=63 , i < 95 , i +=3) x += sqrt(j);

 

Quiz

What output will be produced by the code below?

import Foundation
let number = 16
print("\(number) squared is \(number * number), and its square root is \(sqrt(number))")
Quiz

What output will be produced by the code below?

import Foundation
let number = 16.0
print("\(number) squared is \(number * number), and its square root is \(sqrt(number))")
Quiz

Explain few useful functions in Excel.

Answer:

Following are the functions available in Excel for manipulating the data:

  • Math and Financial Functions – SQRT, DEGREE, RAND(), GCD
  • Logical Functions – IF, AND, FALSE, TRUE
  • Date and Time functions – NOW(), DATEVALUE(), WEEKDAY(NOW())
  • Index Match – VLOOKUP and INDEX MATCH
  • Pivot tables
View

© 2017 QuizBucket.org