answersLogoWhite

0

#include <stdio.h>

#include <math.h>

/* bear in mind that this has no idiot-proofing whatsoever. For example, it doesn't check to see if the numbers entered are positive (and sqrt doesn't handle imaginary numbers) */

int main(int argc, char *argv[]){

float val1, val2, root1, root2;

printf("Gimme a number: ");

scanf("%f", &val1);

printf("Gimme another number: ");

scanf("%f", &val2);

root1 = sqrt(val1);

root2 = sqrt(val2);

printf("The square root of %f is %f.\n", val1, root1);

printf("The square root of %f is %f.\n", val2, root2);

printf("The product of %f and %f is %f\n", root1, root2, root1 * root2);

return 0;

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Examples of logical errors in c program?

Logical errors :- These errors occur because of logically incorrect instructions in the program. Let us assume that in a 1000 line program, if there should be an instruction, which multiplies two numbers and is wrongly written to perform addition. This logically incorrect instruction may produce wrong results. Detecting such errors are difficult.


What results after a cell has gone through mitosis and cytoplasmic division?

it multiplies


A gallery displays a list of?

potential results.


What displays field codes instead of field results?

Shift + F9 will toggle between field codes and results.


What basically is a shell?

A shell is a program that read commands from some input device, typically the keyboard, and displays results on some output device, typically the display. It manages the environment and executes other programs as needed.


In Excel a worksheet that displays the formulas used to create the results is called what?

Formula wooksheet


cross-tab query?

performs calculations on the values in a field and displays the results in a datasheet


What is A peripheral device that displays prints or transmits the results of processing from the computer memory?

Input Device


What is an office feature that displays a list of potential results instead of just the command name?

Gallery


What is a network computer that transmits data a user enters to a host for processing and displays the results?

Terminal


What multiplies by dividing?

Multiplying by dividing can refer to finding the product of two numbers by dividing one number by the reciprocal of the other. For example, to find 5 multiplied by 3, you can divide 5 by 1/3 (which is the reciprocal of 3). This results in 5 x 3 = 15.


Is there a program that creates programs based on users desired results?

What is a center based program?