unit 03 version D Fa3pha

# Unit 03 version D - double fOutput printf"Input A\n" scanf"%f"&fA printf"Input B\n" scanf"%f"&fB

This preview shows pages 1–2. Sign up to view the full content.

Sheet1 Page 1 Unit 03 Readiness Test Version D 1) Volume of a COne #include <stdio.h> #include <math.h> int main(void) { double pi = 22/7 float radius, height double volume printf("Enter the radius and height of the cone\n") volume= (.3)* pi * radius * radius * height printf("The volume of the cone is: %.f \n", volume) getchar() return (0) } 2) Roots of the quadratic equation #include <stdio.h> #include <math.h> int main(void) { float fA, fB, fC, fX

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double fOutput printf ("Input A \n") scanf ("%f", &fA) printf ("Input B \n") scanf ("%f", &fB) printf ("Input C \n") scanf ("%f", &fC) printf ("Input X \n") scanf ("%f", &fX) fOutput = sqrt((fA*(fX*fX)+(fB*fX)+fC)) f if (fA*(fX*fX)+(fB*fX)+fC < 0) { printf ("ERROR") } else { printf ("The output is %f \n", fOutput) } getchar() Sheet1 Page 2 getchar() return (0) r } 3) i) iValue 1= 6 ii) ivalue 2= 3.75 iii) ivalue 3= 6 4) ERROR...
View Full Document

## This note was uploaded on 09/11/2008 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas at Austin.

### Page1 / 2

Unit 03 version D - double fOutput printf"Input A\n" scanf"%f"&fA printf"Input B\n" scanf"%f"&fB

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online