🔒 Closed Pa help naman nito mga idol C language

Status
Not open for further replies.
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
  • 500
    Views
  • 3
    Participants
Last reply from:
iamj

Trending Topics

Online now

Members online
1,113
Guests online
1,599
Total visitors
2,712

Forum statistics

Threads
2,291,350
Posts
29,070,193
Members
1,210,827
Latest member
bugbite
Back
Top