{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# project1 - Name Carlos Moran email [email protected] ECE 3331...

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

/***************************************************** Name - Carlos Moran 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> main( ) { /*********************Setting the variables*********************/ double a, b, c, long_side, sid_1, sid_2, sid_3, trig, trap_area; int isc, sc, eq, risc, rig, count ; isc=0; sc=0; eq=0; risc=0; rig=0; count=0; FILE *fin,*fout; fout = fopen("triangles.out","w"); while ( count <=2){ /********************* Performing task 1 ***********************************/ /*This loop will ask the user to put the side of the triangle until the criteria is matched */ fprintf(fout,"******************Task 1****************** \n\n"); /*This loop will ask the user to put the side of the triangle until the criteria is matched */ do { printf("Enter the value of a: "); scanf( "%lf", &a); printf("Enter the value of b: "); scanf( "%lf", &b); printf("Enter the value of c: "); scanf( "%lf", &c); } while ( a < 0 || b < 0 || c < 0 || ( a + b ) < c || ( b + c ) < a || ( a + c ) < b ); fprintf(fout,"The value of a is: %lf\n", a); fprintf(fout,"The value of b is: %lf\n", b); fprintf(fout,"The value of c is: %lf\n\n", c); /********************* Performing task 2 ***********************************/ fprintf(fout,"******************Task 2****************** \n\n");

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.

{[ snackBarMessage ]}