{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

testanto - Name Carlos email [email protected] ECE 3331...

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

View Full Document Right Arrow Icon
/***************************************************** Name - Carlos email - [email protected] ECE 3331 Computer Project # 1 Semester Spring 2009 **************************************************** Purpose - To calculate and identify the area of triangles **************************************************** Data Files triangle.out - output file to which results will be written*/ #include <stdio.h> #include <math.h> #include <stdlib.h> #define PI 3.14159265 FILE *fin,*fout; main( ) { /*Setting the variables*/ int a, b, c, long_side, sid_1, sid_2, sid_3, trig; FILE *fin,*fout; fout = fopen("triangles2.out","w"); /********************* Performing task 1 ***********************************/ fprintf(fout,"******************Task 1****************** \n"); do { printf("Enter the value of a: "); scanf( "%d", &a); printf("Enter the value of b: "); scanf( "%d", &b); printf("Enter the value of c: "); scanf( "%d", &c); } while ( a < 0 || b < 0 || c < 0 || ( a + b ) < c + 1 || ( b + c ) < a +1 || ( a + c ) < b + 1 ); fprintf(fout,"The value of a is: %d\n", a); fprintf(fout,"The value of b is: %d\n", b); fprintf(fout,"The value of c is: %d\n", c); /********************* Performing task 2 ***********************************/ fprintf(fout,"******************Task 2****************** \n"); if ( a >= b && a >= c ) { long_side=a; sid_1=b; sid_2=c; } else if ( b >= c && b >= a) { long_side=b; sid_1=c;
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}