Answer:
import math
math.sqrt( x )
Explanation:
The basic code that can be written to calculate the square root of a number is as follows
import math
math.sqrt( x )
The correct answer is letter b
Answer:
if 4 slinkies were put down a set of stairs at different times but reached the bottom at the same time. whats the difference?
Explanation:
Answer:
- #include <iostream>
- using namespace std;
- int main()
- {
- const int NUM_VALS = 4;
- int hourlyTemp[NUM_VALS];
- int i;
-
- for (i = 0; i < NUM_VALS; ++i)
- {
- cin >> hourlyTemp[i];
-
- }
-
- /* Your solution goes here */
- for(i = 0; i < NUM_VALS; ++i){
-
- if(i < NUM_VALS -1){
- cout<<hourlyTemp[i]<<",";
- }
- else{
- cout<<hourlyTemp[i];
- }
- }
- cout << endl;
- return 0;
- }
Explanation:
The solution code is given from Line 18 - 26. To print the element from array one after another, we create a for loop to traverse through every element in the array (Line 18). Create an if condition to check if the current index i is not the last index, print the element followed with a comma (Line 20 -22). Otherwise print only the element (Line 23 - 25).