Can someone help me with this program by fixing it I should finish it before tomarrow and I don't know where I went wrong
#include<stdio.h> //header file
#include<conio.h> //header file
#include<stdlib.h> //header file
#include<time.h> //header file
#include<math.h> //header file
#define PI 3.14159 //header file indicating that pie is equal to  3.14159



void mad (int g, int f, int o);
void triangle(int a, int b, int c);
void mac(int first, int second);
void matrices(int m,int n,int p,int q,char op2);
void Areas_volumes();
void sim();
int opt1;
char opt2;
int type;
float x,y;
int m, n, t, d, first[10][10], second[10][10], difference[10][10],sum[10][10], p, q, k, sum1=0, multiply[10][10],transpose[10][10],matrix[10][10];
int g,o,f;
int count1=1;
float a,b,c;
static int incor=0,cor=0,tincor=0,tcor=0;  //declaring integer variables
char ans='Y';

/*declaring the structure and structure variables*/
struct student //structure name
{

            /*declaration of variables for storing the user information*/
         char fname[15];//declaring fname as an character that will be used to collected the user first name
         char lname[15]; //declaring lname as an character that will be used to collected the user last name
         char gender[7]; //declaring gender as an character that will be used to collected the user gender
         int age; //declaring age as an integer that will be used to collected the user age
         int grade;//declaring grade as an integer that will be used to collected the user grade

};



/*main function*/
int main(void) //main function of the program
{ //main function begins
    fflush(stdin);

   FILE * record;

char count;

if ((record = fopen("RECORD.TXT", "w+"))==NULL) //checking if the file can be open
{ //if statement begins
printf("We're soory but the file cannot be opened");//printing that the file can nt be open
} //if statement ends
else

{ //ellse begin

                incor=0,cor=0,tcor=0,tincor=0;
                clrscr();//clearing the screen
               fflush(stdin);

      /*structure*/
       struct student stu;
   puts("\nEnter first name\n");//prompting the user to enter his/her first name
   fflush(stdin);
    gets(stu.fname);//gets user first name

   puts("\nEnter last name\n"); //prompts the user to enter his/her last name
   fflush(stdin);
   gets(stu.lname); //gets user last name

   puts("\nEnter your gender\n"); //prompting the user to enter his/her gender
   fflush(stdin);
   gets(stu.gender); //gets user gender

   printf("\nEnter your age\n"); //prompting the user to enter his/her age
   fflush(stdin);
   scanf("%d",&stu.age); //gets user age

   printf("\nEnter your grade\n"); //prompting the user to enter his/her grade
   fflush(stdin);
   scanf("%d",&stu.grade); //gets user grade
    //do{
      clrscr(); //clearr screen function


/******************************************************************************/

  clrscr();// Clear the screen each time
  while (ans == 'Y')
  {
    printf("\t\t____WELCOME TO THE SUPER SCIENTIFIC CALCULATOR____\n");

    printf("\t\t            CREATED BY ROMARIO FRANKS                       \n");
    printf("\t\t   ******************FOR*********************\n\n\n");
   printf("\t\t_-_-_-_OLD HARBOUR HIGH SCHOOL CXC STUDENTS_-_-_-_\n\n\n");

    printf("\t\t1.         *Details of a Traingle*               \n\n");
    printf("\t\t2.           *  * Matrices *  *             \n\n");
    printf("\t\t3.    *****Simultaneous Equation*****       \n\n");
   printf("\t\t4.          COMPLETING THE SQUARE        \n\n");
   printf("\t\t5.            Areas and Volumes              \n\n");
    scanf("%d", &opt1);

   clrscr();

switch(opt1)
     {
    case 1:

             clrscr();
               printf("Enter the lengths of the three sides of the triangle :");
               scanf("%f%f%f",&a,&b,&c);

             triangle(a,b,c);

             break; //break case 1

    case 2:

             clrscr();
             printf("****<<<<*********<<<<***********MATRICES****<<<<***********<<<<*********\n\n\n");
             printf("\t\t--------------------------_a)SUBTRACT MATRICES__---------------------------\n");
             printf("\t\t**************************_b)  ADD MATRICES   __***************************\n");
             printf("\t\t_________________________--c)MULTIPLY MATRICES--___________________________\n");
             printf("\t\t<<<<<<<<<<<<<>>>>>>>>>>>>__d)TRANSPOSE MATRICES-<<<<<<<<<<<<<<<>>>>>>>>>>>>\n");
             fflush;
             scanf("%s",&opt2);
             clrscr();
              printf("Enter the number of rows and columns of matrix\n");
              scanf("%d%d",&m,&n);
                  printf("Enter the elements of first matrix\n");
              printf("Enter the number of rows and columns of second matrix\n");
              scanf("%d%d",&p,&q);

              matrices(m,n,p,q,opt2);

               printf("Go back to Menu?");
               scanf("%c",ans);
           break;

    case 3:

             clrscr();
             printf("\nEner answer up to 2 decimal place\n");
             printf("\nEnter the value of x\n"); //prompting the user to enter the value of x
             scanf("%f",&x); //getting the value of x
             printf("\nEner answer up to 2 decimal place\n");
             printf("\nEnter the value of y\n"); //prompting the user to enter the value of y
             scanf("%f",&y); //getting the value of y

             sim();

             break;


    case 4:

             clrscr();
            printf("                              COMPLETING THE SQUARE                           \n\n");
             printf(" N.B this calculator can only complete a Quadratic Equation which function is\n\n g(x)(x)+f(x)+o=0 which is also the same as a(x)(x)+b(x)=c=0 into the form\n\n g(x+f)(x+f)+e which is the same as a(x+d)(x+d)+e=0, Example if the function is:3(x)(x)+2(x)+9=0 please only input 3 2 9");
             mad(g,f,o);
            break;

   case 5:


             clrscr();
             printf("*********  PLEASE SELECT AN OPTION BELOW ***********\n\n");
             printf(" a. Square \n\n ");
             printf(" b. Rectangle\n\n");
             printf(" c. Circle\n\n");
             printf(" d. Triangle\n\n");
             printf(" e. Rhombus\n\n");
             printf(" f. PARALLELOGRAM\n\n");
             printf(" g. TRAPEZIUM\n\n");
                 printf(" h. QUADRILATERAL\n\n");
             printf(" i. SEMICERCLE\n\n");
             printf(" j. SECTOR\n\n");
             printf(" k. SPHERE\n\n");
             printf(" l. CONE\n\n");
             printf(" m. CYLLINDER\n\n");
             printf(" n. CUBE\n\n");
             printf(" o. CUBOID\n\n");
             printf(" p. HEMISPHERE\n\n");
             Areas_volumes();

            break;

   default:printf("\nYOU HAVE ENTERED AN INVALID OPTION\n");
     break;
       }
      printf("\n\n Enter 'Y' to continue and 'e' to exit\n");
    scanf("%s",&count);
     }
    /*getting annd printing the user information that was entered in the structure*/
    fscanf(record,"%s %s\t %s\t %d\t %d",stu.fname,stu.lname,stu.gender,stu.age,stu.grade);
    fprintf(record,"Name\t\t Gender\t Age\t Grade\n");
    fprintf(record,"%c %c\t %s\t %d\t %d",stu.fname,stu.lname,stu.gender,stu.age,stu.grade);
    rewind(record);

    fflush(stdin);

     fclose(record);


  // }//else end
   fflush(stdin);
   }


    getch(); //pause the screen
  }
 //***********************************************************************************//

 void matrices(int m,int n,int p,int q,char op2,int first, int second)
 void mac(int first, int second)
{
   switch(op2)
  {
  case 'a':   //Subtraction of Matrices

           clrscr();
        printf("Enter the number of rows and columns of matrix\n");
   scanf("%d%d",&m,&n);
   printf("Enter the elements of first matrix\n");

   for ( t = 0 ; t < m ; t++ )
    {
      for ( d = 0 ; d < n ; d++ )
      {
         scanf("%d",&first[t][d]);
       }
     }
   printf("Enter the elements of second matrix\n");

   for ( t = 0 ; t < m ; t++ )
    {
      for ( d = 0 ; d < n ; d++ )
      {      scanf("%d",&second[t][d]);
       }
    }

   for ( t = 0 ; t < m ; t++ )
     { for ( d = 0 ; d < n ; d++ )
      {
       difference[t][d] = first[t][d] - second[t][d];
     }
      }
   printf("difference of entered matrices:-\n");

   for ( t = 0 ; t < m ; t++ )
   {
      for ( d = 0 ; d < n ; d++ )
       {  printf("%d\t",difference[t][d]);
        }
      printf("\n");
    }

   getch();

   break;
 //}
case 'b':  //Addition of Matrices


    clrscr();
     printf("Enter the number of rows and columns of matrix ");
   scanf("%d%d",&m,&n);
   printf("Enter the elements of first matrix\n");

   for ( t = 0 ; t < m ; t++ )
      for ( d = 0 ; d < n ; d++ )
         scanf("%d",&first[t][d]);

   printf("Enter the elements of second matrix\n");

   for ( t = 0 ; t < m ; t++ )
      for ( d = 0 ; d < n ; d++ )
            scanf("%d",&second[t][d]);

   for ( t = 0 ; t < m ; t++ )
      for ( d = 0 ; d < n ; d++ )
         sum[t][d] = first[t][d]+ second[t][d];

   printf("Sum of entered matrices:-\n");

   for ( t = 0 ; t < m ; t++ )
   {
      for ( d = 0 ; d < n ; d++ )
         printf("%d\t",sum[t][d]);

      printf("\n");
   }

   getch();
break;

case 'c': //Multiplication of Matrices

clrscr();
printf("Enter the number of rows and columns of first matrix\n");
   scanf("%d%d",&m,&n);
   printf("Enter the elements of first matrix\n");

   for (  t = 0 ; t < m ; t++ )
      for ( d = 0 ; d < n ; d++ )
         scanf("%d",&first[t][d]);

   printf("Enter the number of rows and columns of second matrix\n");
   scanf("%d%d",&p,&q);

   if ( n != p )
      printf("Matrices with entered orders can't be multiplied with each other.\n");
   else
   {
      printf("Enter the elements of second matrix\n");

      for ( t = 0 ; t < p ; t++ )
         for ( d = 0 ; d < q ; d++ )
            scanf("%d",&second[t][d]);

      for ( t = 0 ; t < m ; t++ )
      {
         for ( d = 0 ; d < n ; d++ )
         {
            for ( k = 0 ; k < p ; k++ )
            {
               sum1 = sum1 + first[t][k]*second[k][d];
            }

            multiply[t][d] = sum1;
            sum1 = 0;
         }


      printf("Product of entered matrices:-\n");

      for ( t = 0 ; t < m ; t++ )
      {
         for ( d = 0 ; d < q ; d++ )
            printf("%d\t",multiply[t][d]);


      }
   //}

 getch();
//}

break;

case 'd':
clrscr();
printf("Enter the number of rows and columns of matrix ");
   scanf("%d%d",&m,&n);
   printf("Enter the elements of matrix \n");

   for( t = 0 ; t < m ; t++ )
   {
      for( d = 0 ; d < n ; d++ )
      {
         scanf("%d",&matrix[t][d]);
      }
    }

   for( t = 0 ; t < m ; t++ )
   {
      for( d = 0 ; d < n ; d++ )
      {
         transpose[d][t] = matrix[t][d];
      }
   }

   printf("Transpose of entered matrix :-\n");

   for( t = 0 ; t < n ; t++ )
   {
      for( d = 0 ; d < m ; d++ )
      {
         printf("%d\t",transpose[t][d]);
      }
      printf("\n");
   }

 getch();
//}
break;
    }

/*************************************************************************************************************************************************************/
   // GIVE DETAILS OF A TRIANGLE
  void triangle(int a, int b, int c)
  {
  int a,b,c,S,D,A,B,C,Area,R;
  printf("Enter the lengths of the three sides of the triangle :");
       scanf("%f%f%f",&a,&b,&c);


    S =(a+b+c)/2.0;        // S is the semiperimeter of the triangle
   D = S*(S-a)*(S-b)*(S-c); //D is the square of the area of the triangle
     if(D<=0)
     {
      printf("The triangle cannot be formed");
       getch();
        exit(0);


         if((a==b || b==c || c==a) && !(a==b && b==c && c==a))
            // this complex logic is to eliminate interpretting a triangle with all three angles

            // sides equal as both isosceles and equilateral.
            {
            printf("\t\tThe triangle is ISOSCELES\n");

            }
            if(a==b && b==c && c==a)
                {
            printf("\t\tThe triangle is EQUILATERAL\n");
                }
                         if(a!=b && b!=c && c!=a)
                                    {
                                printf("\t\tThe triangle is SCALENE\n");
                                }

                 Area=sqrt(D);

                    R = (a*b*c)/(4.0*Area);

                    printf("\t\tPERIMETER=%.2f units\n\n",(2.0*S));
               {
                    printf("\t\tAREA=%.2f sq.units\n\n",Area);
                    }
               {
                   printf("\t\tCIRCUM RADIUS=%.2f units\n\n",R);
                    }
                                    // using sine rule,we get...
               A = (180.0/3.1415926)*asin(a/(2.0*R));   //  value of pi should be upto 7
               B = (180.0/3.1415926)*asin(b/(2.0*R));  //  decimal places of accuracy and also

               C = (180.0/3.1415926)*asin(c/(2.0*R)); //  note that the 7th decimal place

                     // is 6 and not 7 as it had to be if were
                if(A==90.0 || B==90.0 || C==90.0)     //  approximated to 7 decimal places


                printf("\t\tThe triangle is RIGHT ANGLED\n");

                if(A<90.0 && B<90.0 && C<90.0)

                printf("\t\tThe triangle is ACUTE ANGLED\n");

                if(A>90.0 || B>90.0 || C>90.0)

                printf("\t\tThe triangle is OBTUSE ANGLED\n");


                printf("\n\nThe angles are as follows:\n");


                printf("\t\tA = %.2f degrees\n",A);


                printf("\t\tB = %.2f degrees\n",B);


                printf("\t\tC = %.2f degrees\n",C);


                printf("Where A,B,C stand for angles opposite to sides%.2f,%.2f,%.2f\n",a,b,c);


                printf("respectively");
                }
                getch();

                 }
//********************************************************************************************************************************************************//

//FIND THE AREAS AND VOLUMES OF ALL SHAPES IN THE CXC LEVEL
void Areas_volumes()

 {
 char opt3;
 clrscr();

 scanf("%s",&opt3);
        }
     switch(opt3)
      {


        case 'a':
                clrscr();
            float s,a,p;
            printf("Enter side of square:");
            scanf("%f",&s);
            a=s*s;
            p=4*s;
            printf(" Perimeter of square  : %.3f units\n\n",p);
            printf(" Area of square       : %.3f sq.units\n\n",a);

                getch();
                break;
        case 'b':
                clrscr();

           float a,p,l,b;
            printf("Enter length and breadth of rectangle: Length:");
            scanf("%f",&l);
            printf("Breadth:");
            scanf("%f",&b);
            a=l*b;
            p=2*(l+b);
            printf("Perimeter of rectangle  : %.3f units\n\n",p);
            printf("Area of rectangle       : %.3f sq.units\n\n",a);

          getch();
                break;
        case 'c':
                clrscr();

          float area,p;
          float a,b,c,s;
          printf("Enter three sides of triangle:");
          scanf( "%f%f%f",&a,&b,&c);
          p=a+b+c;
          s=p/2;
          area=sqrt(s*(s-a)*(s-b)*(s-c));
          printf("Perimeter of triangle : %.3f units\n\n",p);
          printf("Area of a triangle    : %.3f sq.units\n\n",area);

         getch();

         break;
        case 'd':
                clrscr();

          float r,a,p;
          printf("Enter radius of circle:");
          scanf("%f",&r);
          a=PI * r * r;
          p=2 * PI * r;
          printf(" Circumference of circle : %.3f units\n\n",p);
          printf(" Area of circle          : %.3f sq.units\n\n",a);

                getch();
                break;
        case 'e':
                clrscr();

           float s,d1,d2,a,p;
           printf(" Enter side and diagonals of a rhombus Side:");
           scanf("%f",&s);
           printf(" Diagonal :\n");scanf("%f",&d1);
           printf("Diagonal :\n");scanf("%f",&d2);
           a=0.5*d1*d2;
           p=4*s;
           printf("Perimeter of rhombus   :%.3f units\n\n",p);
           printf("Area of rhombus        :%.3f sq.units\n\n",a);

                getch();
                break;
        case 'f':
                clrscr();

          float a,p,base,h,l,b;
          printf("Enter height,length,breadth of parallalogram :" );
          printf(" Height :\n"); scanf("%f",&h);
          printf("Base or Length :\n"); scanf("%f",&l);
          printf("Breadth :\n"); scanf("%f",&b);
          base=l;
          a=base*h;
          p=2 * ( l + b );
          printf("Perimeter of parallalogram :%.3f units\n\n",p);
          printf("Area of parallogram        :%.3f sq.units\n\n",a);


                getch();
                break;

        case 'g':
                clrscr();

          float a,b,d,are;
          printf("Enter height and lengths of two parallel sides:Height :");
          scanf("%f",&d);
          printf("Side:\n"); scanf("%f",&a);
          printf("Side:\n"); scanf("%f",&b);
          are=0.5 * d * (a+b);
          printf("Area of trapezium : %.3f sq.units\n\n",are);

                getch();
                break;
        case 'h':
                clrscr();

         float a,b,area,d;
         printf("Enter diagonal and perpendicular distances from opposite vertices: ");

         printf("Diagonal :\n"); scanf("%f",&d);
         printf(" Distance :\n"); scanf("%f",&a);
         printf("Distance :");scanf("%f",&b);
         area= 0.5 * d * (a + b);
         printf("Area of quadrilateral : %.3f sq.units\n\n", area);

                getch();
                break;
        case 'i':
                clrscr();

          float a,p,r;
          printf("Enter radius of semicircle:");
          scanf("%f",&r);
          a=0.5* PI * r * r;
          p= (PI * r ) + (2 * r);
          printf(" Circumference of semicircle : %.3f units\n\n",p);
          printf(" Area of semicircle          : %.3f sq.units\n\n",a);

                getch();
                break;
        case 'j':
                clrscr();

          float x,r,temp,a,p;
          printf("Enter radius and angle of sector:");
          printf("Radius :\n");
          scanf("%f",&r);
          printf(" Angle(in degrees) :\n");
          scanf("%f",&x);
          temp= x/360;
          a= temp * (PI * r * r);
          p= temp * (2 * PI * r);
          printf("Circumference of sector : %.3f units\n\n",p);
          printf("Area of sector          : %.3f sq.units\n\n",a);

                getch();
                break;

        case 'k':
               clrscr();

           float tsa,v,r;
           printf("Enter radius of sphere :");
           scanf("%f",&r);
           tsa=4*PI*r*r;
           v=(4.0/3.0)*PI*r*r*r;
           printf("Total surface area of sphere   :%.3f sq.units\n\n",tsa);
           printf("Volume of sphere               :%.3f cu.units\n\n",v);

               getch();
               break;
        case 'l':
                clrscr();

          float h,r,s ,v,tsa,lsa;
          printf("Enter base radius ,height, slant height of cone :");
          printf("Radius :\n"); scanf("%f",&r);
          printf("Height :\n"); scanf("%f",&h);
          printf(" Slant height :"); scanf("%f",&s);
          tsa=PI * r *(s+r);
          lsa=PI * r * s;
          v=(PI * r * r * h)/3;
          printf("Total surface area of cone    :%.3f sq.units\n\n",tsa);
          printf("Lateral surface area of cone  :%.3f sq.units\n\n",lsa);
          printf("Volume of cone                :%.3f cu.units\n\n",v);

                getch();
                break;
        case 'm':
                clrscr();

            float lsa,tsa,v,r,h;
            printf("Enter height and radius of cyllinder");
            printf("Height :\n"); scanf("%f",&h);
            printf("Radius :\n"); scanf("%f",&r);
            lsa=2*PI*r*h;
            tsa=2*PI*r*(h+r);
            v=PI*r*r*h;
            printf("Total surface area of cyllinder  :%.3f sq.units\n\n",tsa);
            printf("Curved surface area of cyllinder :%.3f sq.units\n\n",lsa);
            printf("Volume of cyllinder              :%.3f cu.units\n\n",v);

                getch();
                break;

        case 'n':
                clrscr();

           float  lsa,tsa,v,s,d;
           printf("Enter side of cube :");
           scanf("%f",&s);
           d=s*sqrt(3);
           lsa=4 * s * s;
           tsa=6 * s * s;
           v= s * s * s;
           printf("Diagonal of cube              :%.3f units\n\n",d);
           printf("Total surface area of cube    :%.3f sq.units\n\n",tsa);
           printf("Lateral surface area of cube  :%.3f sq.units\n\n",lsa);
           printf("Volume of cube                :%.3f cu.units\n\n",v);

                getch();
                break;
        case 'o':
                clrscr();

          float lsa,tsa,v,l,b,d,h;
          printf("Enter length,breadth,height of cuboid :");
          printf("Length :\n\n");  scanf("%f",&l);
          printf("Breadth :\n\n");  scanf("%f",&b);
          printf("Height :\n\n");  scanf("%f",&h);
          d=sqrt(l*l + b*b + h*h );
          lsa =2 * h *( l+b );
          tsa = lsa + 2 * l * b;
          v=l*b*h;
          printf("Diagonal of cuboid              :%.3f units\n\n",d);
          printf("Total surface area of cuboid    :%.3f sq.units\n\n",tsa);
          printf("Lateral surface area of cuboid  :%.3f sq.units\n\n",lsa);
          printf("Volume of cuboid                :%.3f cu.units\n\n",v);

                getch();
                break;
        case 'p':
                clrscr();

              float lsa,tsa,v,r;
           printf("Enter radius of hemisphere :");
           scanf("%f",&r);
           tsa=3*PI*r*r;
           lsa=2*PI*r*r;
           v=(2.0/3.0)*PI*r*r*r;
           printf("Total surface area of hemisphere    :%.3f sq.units\n\n",tsa);
           printf("Lateral surface area of hemisphere  :%.3f sq.units\n\n",lsa);
           printf(" Volume of hemisphere                :%.3f cu.units\n\n",v);
                getch();
                break;


}



//***********************************************************************************************************************************************************************//

// Completing the Square
void mad (int g, int f, int o)
{
printf("%d(x)(x)+%d(x)+%d=0",g,f,o);
printf("%d(x)(x)+%d(x)+%d=0",g,f,o);
printf("(x)(x)+%d/%d(x)+%d/%d=0",f,g,o,g);
printf("(x)(x)+%d/%d(x)=-%d/%d",f,g,o,g);
printf("(x)(x)+%d/%d(x)+[%d/2(%g)][%d/2(%d)]=-%d/%d+[%d/2(%d)][%d/2(%d)]",f,g,f,g,f,g,o,f,g,f,g);
printf("[(x)+%d/2(%d)][(x)+%d/2(%d)]=(-%d/%d)+(%d/2(%d))(%d/2(%d))",f,g,f,g,o,g,f,g,f,g);
printf("[(x)+%d/2(%d)][(x)+%d/2(%d)]+(%d/%d)-(%d/2(%d))(%d/2(%d))=0",f,g,f,g,o,g,f,g,f,g);
printf("[(x)+%d/2(%d)][(x)+%d/2(%d)]+(%d-(%d*%d)/4(%d))=0",f,g,f,g,o,f,f,g);
getch();
}



//*******************************************************************************************************************************************************************************//
//Simultaneous Equation


void sim()
{
        int a,b,c,d,e,f; //declaring integer variables
   float x,y,yl,ansx,ansy; //declaring numeric decimal variables
   float bl,cl,el,fl,m; //declaring numeric decimal variables
   //static int tcor=0, tincor=0;
                clrscr(); //clear screen function
      printf("\n\t^^^^^^^^ Welcome To Simultaneous Equation Section ^^^^^^^^\n\n");
                int p; //declaring 'p' as an integer
                for(p=0; p<2; p++) //looping 'p' two (2) times
                { //for loop begins
                    clrscr(); //clear screen funnction

                    srand(time(NULL));

                a=1+rand()%5; //getting the value of 'a' using random numbers between 0 and 6
                b=6+rand()%10; //getting the value of 'b' using random numbers between 5 and 11
                c=11+rand()%35; //getting the value of 'c' using random numbrs between 10 and 36
                d=1+rand()%5; //getting the value of 'd' using random numbers between 0 and 6
                e=6+rand()%10; //getting the value of 'e' using random numbers between 5 and 11
                f=11+rand()%30; //getting the value of 'f' using random numbrs between 10 and 31

                printf("%dx + %dy = %d\n",a,b,c);//printing equation 1
                     printf("%dx + %dy = %d\n",d,e,f);//printing equation 2


                     bl=b*d;
                     cl=c*d;
                     //dl=d*a
                     el=(e*a);
                     fl=(f*a);

                     yl=bl-el;
                ansy=(cl-fl)/(yl); //calculating the answer for y
                     //ansx= ((b*ansy)-c)/a;
                     //y=(f-e)/d;
                     m=(e*ansy);
                    ansx= (f-m)/(d); //calculating the answer for x

                     printf("\nEner answer up to 2 decimal place\n");
                    printf("\nEnter the value of x\n"); //prompting the user to enter the value of x
                     scanf("%f",&x); //getting the value of x
                     printf("\nEner answer up to 2 decimal place\n");
                     printf("\nEnter the value of y\n"); //prompting the user to enter the value of y
                     scanf("%f",&y); //getting the value of y

                    if(x==ansx) //comparing the value of x that the user entered with the calculated value of x
                { //if begins
                    cor++; //incrimenting cor by 1
                    printf("\nYour x value is correct\n"); //printing that the value of x tht the user entered is correct
                } //if ends
                  else
                    {//else begins
                        printf("\nYour x value is incorrect");//printing that the value of x that the user entered is incorrect
                        incor++; //incrimenting incor by 1
                             printf("\nThe correct answer for x is %0.2f",ansx);//printing the correct value for x
                       } //else ends

                if(y==ansy)//cmparing the value of y that the user entered with the calculated value of y
                {//if begins
                    cor++; //incrimenting cor by 1
                    printf("\n\nYour y value is correct\n"); //printing that the value of y that the user entered is correct
                }//if ends
                  else
                    { //else begins
                        printf("\n\nYour y value is incorrect");//printing that the value of y that the user entered is incorrect
                         incor++; //incrimenting incor by 1
                             printf("\nThe correct answer for y is %0.2f",ansy); //printing the correct value of y
                      printf("\n\n");
                       }//else ends
                  if(cor==2) //checking if cor equal to 2
                  { //if begins
                    tcor++; //incrimenting tcor by 1
                  } //if ends
                  else
                  { //else begins
                    tincor++; //incrimenting tincor by 1
                  } //else end
                  } //for loop ends
                  printf("\nSimultaneous Equation Test"); //printing the name of the test did
                  printf("\n Ouestions did= %d",p); //printing the amount of questions in the test
                       printf("\n Correct=%d",tcor); //printing the amount of questions the user gets correct
                        printf("\n Incorrect=%d",tincor); //printing the amount of questions the user get incorrect
                  getch();
}}
//**************************************

Recommended Answers

All 2 Replies

Dude, this has hundreds of errors when I compiled. Either you post a proper code or point out which line of code concerns you.

Basically , you have messed up with you curly braces a lot. Check into them.

> D = S*(S-a)*(S-b)*(S-c); //D is the square of the area of the triangle
>      if(D<=0)
>      {
>       printf("The triangle cannot be formed");
>        getch();
>         exit(0);
>          if((a==b || b==c || c==a) && !(a==b && b==c && c==a))
>             // this complex logic is to eliminate interpretting a triangle with all three angles
>             // sides equal as both isosceles and equilateral.

Like for example in above code the if after exit statement will never be executed once it enters the first if

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.