If code with calculations?

Is it possible ro make an if statement, where the result of something is tested?
For example:

if (float(A)/float(B)*100.0 > X)
{...
}

Yes, it is possible. C++ allows it.

voltamperoff: Yes, it is possible. C++ allows it.

If i do that, I get the error message:

lvalue required as left operand of assignment

Your error is probably in a different line. Post your entire sketch, in code tags please.

aarg:
Your error is probably in a different line. Post your entire sketch, in code tags please.

#include <LCD.h>
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
#define outputA 6
#define outputB 7
float A = 1020;
float I = 1;
float Y = 363;
float Z = Y/A*100.0;
float X = A-Y;
int Ropin = 8;
int Gepin = 9;
int Grpin = 10;
int counter = 0;
int aState;
int aLastState;

void setup() {
lcd.begin( 20, 4 );
lcd.clear();
lcd.setCursor( 0, 0 );
pinMode (outputA,INPUT);
pinMode (outputB,INPUT);
Serial.begin (9600);

aLastState = digitalRead(outputA);
}

void loop() {
aState = digitalRead(outputA);
if (aState != aLastState) {
  if (digitalRead(outputB) != aState)  {
  Y ++;
} else {
  Y --;
}
Serial.print ("P:");
Serial.println(D);
lcd.begin( 20, 4 );
lcd.clear();
lcd.setCursor( 0, 0 );
lcd.print(A-Y,0);
lcd.setCursor( 0, 1 );
lcd.print(Y,0);
lcd.setCursor( 0, 2 );
lcd.print(Y/A*100.0,0);

if (Y/A*100.0 < 40)
{pinMode(Ropin, OUTPUT);
digitalWrite(Ropin, HIGH);
}
if ((Y/A*100.0 < 50) && (Z < 40)){
pinMode(Ropin, OUTPUT);
digitalWrite(Ropin, HIGH);
pinMode(Gepin, OUTPUT);
digitalWrite(Gepin, HIGH);
}
 if ((Y/A*100.0 < 65) && (Z > 50)){
pinMode(Gepin, OUTPUT);
digitalWrite(Gepin, HIGH);
}
 if ((Y/A*100.0 < 75) && (Z > 65)){
pinMode(Gepin, OUTPUT);
digitalWrite(Gepin, HIGH);
pinMode(Grpin, OUTPUT);
digitalWrite(Grpin, HIGH);
}
 
 if ((Y/A*100.0 < 99) && (Z > 75)){
pinMode(Grpin, OUTPUT);
digitalWrite(Grpin, HIGH);
}
if (Y/A*100.0 = 100);{
pinMode(Ropin, OUTPUT);
digitalWrite(Ropin, HIGH);
pinMode(Gepin, OUTPUT);
digitalWrite(Gepin, HIGH);
pinMode(Grpin, OUTPUT);
digitalWrite(Grpin, HIGH);
}
}      
}
    if (Y / A * 100.0 = 100); {

must be

    if (Y / A * 100.0 == 100); {

Here's the obvious culprit: = is assignment, not comparison

    if (Y/A*100.0 = 100);

[ and indent your code, its impossible to read otherwise ]

Walk placidly amidst the haste. Use a standard indentation to clearly show the code blocks. Never put more than one statement per line. Place any brackets by themselves on a separate line. Use blank lines sparingly, no more than one at a time. Give things descriptive names. Use descriptive variable names, for example "temperature" instead of "t". You can name numerical constants, pin numbers, variables and many other things in this way. For example, you can refer to a pin and an output level by number, like digitalWrite(3,0). But such a statement doesn't reveal anything about the purpose. digitalWrite(hornRelayPin, LOW) does. You can do that by declaring const byte hornRelayPin = 3; before setup() in your program. Many such names are already defined for you by the compiler and the Arduino IDE. Here are some:

#define HIGH 0x1
#define LOW  0x0
#define PI 3.1415926535897932384626433832795

Use them. There are many more. Use compiler math to compute values so you can see where they came from (or at least document them). For example, if you see the number 73, you would be hard put to explain the significance of it. But if you see "daysPerYear/5", it is obvious. One more thing. When you work on program continuously, you become familiar with it. So many things seem obvious even if they are not spelled out explicitly. But try looking at your own code six months later. It will be as if a stranger wrote it. So write for strangers, not yourself.

if (Y/A*100.0 = 100);{two discreet coughs}