Hi everyone,

I'm writing a program that should take in a number, e.g. 12345, and convert it to what my professor calls engineering notation, e.g. 12k. My code is probably longer than it needs to be, but I'm really focusing on readability and using each function for one purpose. My program successfully checks the input and, if invalid, notifies the user accordingly. However, upon receiving valid input, it just prints a newline and then prompts the user for a new number. Here is my code:

Code:
#include <stdio.h>
#include <math.h>
#include <ctype.h>

#define MIN 1
#define MAX pow(10, 15)

int fnCheck(long double);
char * fnCalculateFor(long double);
int fnReactTo(long double);

int fnCheck(long double d) {

  int isDouble = scanf(" %Lf", &d);
  int isWithinBounds = d >= MIN && d < MAX;
  int status = d ? (isDouble + isWithinBounds) * isDouble : 3;
  return status;
  
}

char * fnCalculateFor(long double d) {

  char prefixes[7] = {'_', 'k', 'M', 'G', 'T', 'P'};
  static char out[10];
  long double n;
  
  for (int i = 5; i >= 0; i--) {
    if ((n = d / pow(10, i * 3)) >= 1) {
      snprintf(out, sizeof(out), " = %d%c\n", (int) n, prefixes[i]);
      break;
    }
  }
  return out;
  
}

int fnReactTo(long double d) {
  
  int inDex = fnCheck(d);
  int g = 1;
  
  switch (inDex) {
    case 0:
      puts("\nInvalid input. Shutting down...");
    case 3:
      g--;
      break;
    case 2:
      puts(fnCalculateFor(d));
      break;
    case 1:
      puts("\nNumber must be in range 1 ... 1e15.");
  }
  return g;
   
}

int main(void) {
  
  long double input;
  int goAhead;

  puts("Welcome to the homework guide. At any time enter 0 to exit the application.  User input is constrained between 1 and 999,999,999,999,999.\n");
  
  do {
    puts("Please enter a number: ");
    goAhead = fnReactTo(input);
  } while (goAhead);
  
  puts("\nThank you for using the application.");
  return 0;
  
}

I don't know whether the calculations are even being done, or if the error is somewhere else in the program. As mentioned in previous posts, I am pretty much brand new to C and I don't necessarily fully understand some concepts even if I apply them here, e.g. pointers.

Any help appreciated!