#include <stdio.h>

int main() {
    float x1, x2, y1, y2, m, p;
    
    printf("Inserisci i valori di x1 e x2: ");
    do {
        scanf("%f %f", &x1, &x2);      
    } while (x1 == x2);
    printf("Inserisci i valori di y1 e y2: ");
    scanf("%f %f", &y1, &y2); 
    m = (y2 - y1) / (x2 - x1);
    p = y1 - m * x1;
    
    printf("Il coeff angolare e' %f:\nL'intercetta e' %f:\n", m, p); 
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: