pastebin

Paste Search Dynamic
Recent pastes
program will calculate the slo
  1. // C code
  2. // This program will calculate the slope of a line.
  3. // Developer: Gueler Stevens CMIS102 Lab4
  4. // Date: June 15, 2020
  5. #include <stdio.h>
  6.  
  7. int main ()
  8. {
  9.     /* variable definition: */
  10.     float m, x, b, y;
  11.  
  12.     /* Initialize calculation */
  13.     y = 0;
  14.     printf("Enter a Float value for m\n");
  15.     scanf("%f", &m);
  16.     printf("Enter a Float value for x\n");
  17.     scanf("%f", &x);
  18.     printf("Enter a Float value for b\n");
  19.     scanf("%f", &b);
  20.     y = m*x + b;
  21.     printf("Slope of the line is: %f\n " , y );
  22.     if (y > 10)
  23.        printf("The value is greater than 10\n");
  24.     return 0;
  25. }
Parsed in 0.004 seconds