Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
314 B
2
Indexable
Never
#include <stdio.h>

int main(void) {
  float a, b, x;
  printf("input a =");
  scanf("%f", &a);
  
  printf("input b =");
  scanf("%f", &b);
  
  if(a == 0){
    if(b == 0){
      printf("x = any number"); 
    }
    else{
      printf("there is no solution");
    }
  }
  else{
    printf("x = %f\n", -b/a);
  }
}
Leave a Comment