🔒 Closed Pa help naman nito mga idol C language

Status
Not open for further replies.

Rojen G Embate

Honorary Poster
daming pina pagawa ng instructor namin di man lang nag bigay ng examples pano gawin yan

329871491_953008309406769_7317267789791521747_n.webp
 
C:
#include <stdio.h>

int main() {
    float x1, y1, x2, y2, slope;
    
    // Prompt the user to enter the coordinates
    printf("Enter x1, y1, x2, y2 respectively: ");
    scanf("%f%f%f%f", &x1, &y1, &x2, &y2);
    
    // Compute the slope of the line using the formula m = (y2 - y1)/(x2 - x1)
    slope = (y2 - y1) / (x2 - x1);
    
    // Display the slope of the line with 2 decimal places
    printf("The slope of the line is %.2f\n", slope);
    
    return 0;
}

1676624560264.webp


1676624600527.webp

1676624641176.webp
 
C:
#include <stdio.h>

int main() {
    float x1, y1, x2, y2, slope;
   
    // Prompt the user to enter the coordinates
    printf("Enter x1, y1, x2, y2 respectively: ");
    scanf("%f%f%f%f", &x1, &y1, &x2, &y2);
   
    // Compute the slope of the line using the formula m = (y2 - y1)/(x2 - x1)
    slope = (y2 - y1) / (x2 - x1);
   
    // Display the slope of the line with 2 decimal places
    printf("The slope of the line is %.2f\n", slope);
   
    return 0;
}

View attachment 2522713

View attachment 2522714
View attachment 2522715
salamat sir
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 495
    Views
  • 3
    Participants
Last reply from:
iamj

Online now

Members online
1,032
Guests online
747
Total visitors
1,779

Forum statistics

Threads
2,275,585
Posts
28,964,275
Members
1,231,875
Latest member
cjpeligro123
Back
Top