Attachment '6.0.2.c'

Download

   1 #include <stdio.h>
   2 #include <math.h>
   3 int main (int argc, char **argv) {
   4 	float a, b, c; /* input variables */ 
   5 	float S, P; /* output */
   6 	
   7 	/* input data */ 
   8 	printf( "a = " );
   9 	scanf( "%f", &a );
  10 	printf( "b = " );
  11 	scanf( "%f", &b );
  12 	
  13 	/* compute what needed */ 
  14 	c = sqrt(a*a + b*b); /* compute hypotenuse */
  15 	P = a + b +c;
  16 	S = a * b / 2;
  17 	
  18 	/* print results */
  19 	printf( "just in case, c = %1.4f\n", c );
  20 	printf( "P = %1.4f,\nS = %1.4f\n", P, S );
  21 	
  22 	return 0;
  23 };

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.