1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    float coeficiente_de_x1, coeficiente_de_x2, coeficiente_de_y1, coeficiente_de_y2, constante_1;
    float constante_2, x, y;
    printf ("Ingresa el valor de coeficiente de x1: ");
    scanf ("%f", &coeficiente_de_x1);
    (void) getchar ();
    printf ("Ingresa el valor de coeficiente de x2: ");
    scanf ("%f", &coeficiente_de_x2);
    (void) getchar ();
    printf ("Ingresa el valor de coeficiente de y1: ");
    scanf ("%f", &coeficiente_de_y1);
    (void) getchar ();
    printf ("Ingresa el valor de coeficiente de y2: ");
    scanf ("%f", &coeficiente_de_y2);
    (void) getchar ();
    printf ("Ingresa el valor de constante 1: ");
    scanf ("%f", &constante_1);
    (void) getchar ();
    printf ("Ingresa el valor de constante 2: ");
    scanf ("%f", &constante_2);
    (void) getchar ();
    x=(coeficiente_de_y1*constante_2-coeficiente_de_y2*constante_1)/(coeficiente_de_y1*coeficiente_de_x2-coeficiente_de_y2*coeficiente_de_x1);
    y=(constante_2-coeficiente_de_x2*x)/coeficiente_de_y2;
    printf ("Valor de x: %g\n", x);
    printf ("Valor de y: %g\n", y);
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}