Float trouble

As a C self-learning 'C' project, I'm trying to create a simple 4-function calculator. I've succeeded, but only using integer numbers. Using 'FLOAT" to include the fractional part has me stumped. I really don't know just where to make my variables FLOAT type ?????

Please help. My sketch follows below;

float A;//1st number
float B;//2nd number
float ans;//answer
int OP;//operation choice add, subtract, multiply or divide

String msgA = "Enter A, then hit Enter.";
String msgB = "Enter B, then hit Enter.";
String msgOP = "Enter 1 for add, 2 for subtract, 3 for multiply, 4 for divide";
String msgEnd = "Your answer is:";

void setup() {
// put your setup code here, to run once:
String msgA = "Enter A, then hit Enter.";
String msgB = "Enter B, then hit Enter.";
String msgOP = "Enter 1 for add, 2 for subtract, 3 for multiply, 4 for divide";
String msgEnd = "Your answer is:";

Serial.begin(9600);
Serial.println("4-Function, two number calculator using function calls.");
Serial.println();
}

void loop() {

Serial.println(msgA);
while (Serial.available() == 0) { //waiting for 1st number A
}
A = Serial.parseInt(); //get A
Serial.println(A);
Serial.println(msgB);
while (Serial.available() == 0) { //waiting for 2nd number B
}
B = Serial.parseInt(); //get B
Serial.println(B);
Serial.println(msgOP);
while (Serial.available() == 0) { //waiting for OP (function) choice
}
OP = Serial.parseInt(); //get OP (function) selection
//function select
switch (OP) {
  case 1:
    ADD (A, B);
    break;
  case 2:
    SUB (A, B);
    break;
  case 3:
    MUL (A, B);
    break;
  case 4:
    DIV (A, B);
    break;

    //Serial.println(ans);
}
}

// Functions are below. New functions e.g. ADD,SUB, MUL amd DIV  MUST BE OUTSiDE Setup AND Loop !!!!!

void ADD( float A, float B) {

ans = A + B;
Serial.println(msgEnd);
Serial.println(ans);
Serial.println();
}
void SUB(float A, float B) {

ans = A - B;
Serial.println(msgEnd);
Serial.println(ans);
Serial.println();

}
void MUL(float A, float B) {

ans = A * B;
Serial.println(msgEnd);
Serial.println(ans);
Serial.println();

}
void DIV(float A, float B) {

ans = A / B;
Serial.println(msgEnd);
Serial.println(ans);
Serial.println();

}

Maybe replace parseInt() with the parseFloat() function where applicable?

You were previously asked to read the forum stickies about posting guidelines. Since you haven't used code tags again, now would be a good time.

Sorry, I'll try to remember next time.

You can edit your OP to put the code in code tags.

groundFungus:
You can edit your OP to put the code in code tags.

I'll try to remember next time.

How do I edit my OP to add the code tags? ??

Below your post you see Quick Edit More? Click on More, then Modify. Highlite (select) your code. Click the </> in the menu bar (far left).

Serial Input Basics

https://forum.arduino.cc/index.php?topic=396450

The code tags seem to be in my OP now. Please confirm.

Thanks again for your help. My sketch runs correctly now.

The code tags seem to be in my OP now. Please confirm.

Not even close.

I put </> at my OP sketch start, and I put </> at the end.

Isn't that what you advised ??

ardocman:
I put </> at my OP sketch start, and I put </> at the end.

Isn't that what you advised ??

Well you were told this:

Below your post you see Quick Edit More? Click on More, then Modify. Highlite (select) your code. Click the </> in the menu bar (far left).

Which is not what you did is it?

I tried again, but don't know what the post should like when finished i.e. I don't see the </> tags themselves. Please check and see if the 'code-tag' modification actually worked.

You got it. Good job.