Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // cw coleman Do not copy and pase this code. Type it. I did!
- //compile gcc inputabc.c -o inputabc -lm
- // run ./inputabc
- #include <stdio.h>
- #include <math.h>
- float squareroot (float a, float b,float c);
- float main(){
- float a,b,c,d;
- printf("\n\t ************* ************* ************* ************* *************\n");
- printf("\t Type in 3 values for a,b and c. Type Enter after each input.\n");
- printf("\t The square root of a+b+c will be calculated and displayed.\n");
- printf("\t Input a:");
- scanf("%f", &a );
- printf("\t Input b:");
- scanf("%f", &b );
- printf("\t Input c:");
- scanf("%f", &c );
- d = squareroot(a,b,c);
- printf("\n\t a = %f b = %f c = %f",a,b,c);
- printf("\n\t The square root of a+b+c is %f ",d);
- printf("\n\t ************* ************* ************* ************* *************\n");
- return 0;
- }
- float squareroot (float a, float b, float c){
- float d = sqrt(a+b+c);
- return d;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement