SOLUTION OF TWO VARIABLES LINEAR EQUATIONS

#include <stdio.h>
void main()
{
    //@codewithsandhan
    float a1, b1, c1, a2, b2, c2, x, y;
    printf("      \U0001F610   SOLUTION OF TWO VARIABLES LINEAR EQUATIONS !!!!\n\n\n");
    printf("      equation 1   =>     \U0001F560       a1.x  +  b1.y  +c1  =  0  \n      equation 2   =>     \U0001F560       a2.x  +  b2y  + c2  =  0  \n\n");
    printf("        \U0001F913   Enter the value of a1 :  ");
    scanf("%f", &a1);
    printf("\n        \U0001F913   Enter the value of b1 :  ");
    scanf("%f", &b1);
    printf("\n        \U0001F913   Enter the value of c1 :  ");
    scanf("%f", &c1);
    printf("\n\n");
    printf("        \U0001F920   Enter the value of a2 :  ");
    scanf("%f", &a2);
    printf("\n        \U0001F920   Enter the value of b2 :  ");
    scanf("%f", &b2);
    printf("\n        \U0001F920   Enter the value of c2 :  ");
    scanf("%f", &c2);
    printf("\n\n");
    x = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
    y = (c1 * a2 - c2 * a1) / (a1 * b2 - a2 * b1);
    printf("The two equations are :-  \U0001F481  (%2.f).x  +  (%2.f).y  +  (%2.f)  = 0  \n\n", a1, b1, c1);
    printf("                         \U0001F481     (%2.f).x  +  (%2.f).y  +  (%2.f)  = 0 \n\n\n", a2, b2, c2);
    printf("      Solutions are \U0001F646 x = %f   and  \U0001F646 y = %f ", x, y);

Comments