Answer:
Explanation:
The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter a number of type double to calculate square root:");
double num = in.nextDouble();
rootPositive(num);
}
public static void rootPositive(double num) {
if (num > 0) {
System.out.println(Math.sqrt(num));
} else {
System.out.println("Number must not be negative.");
}
}
}
Answer:
<h3>Norman only likes to stuff birds, not other animals.</h3>
Ethics:
- to ensure that privacy will not be lost.
-ensuring personal information is not lost
-information in the accountings will not be submitted or shared with anyone
-information will be saved and viewed by the business.
- The business will not falsely make the accountings.
The answer is c. I just took it on apex n that’s what I got lol
Answer:
#include<bits/stdc++.h>
using namespace std;
int sumOfinteger(int );
// Returns sum of all digits in numbers from 1 to n
int sumOfintegersFrom1ToN(int n) {
int result = 0; // initialize result
// One by one compute sum of digits in every number from
// 1 to n
for (int x = 1; x <= n; x++)
result += sumOfinteger(x);
return result;
}
// A utility function to compute sum of digits in a
// given number x
int sumOfinteger(int x) {
int sum = 0;
while (x != 0) {
sum += x %10;
x = x /10; }
return sum; }
// Driver Program
int main() {
int n ;
cout<<"enter a number between 1 and n : ";
cin>>n;
cout << "Sum of digits in numbers from 1 to " << n << " is " << sumOfDigitsFrom1ToN(n);
return 0; }