You are not supposed to work out if you have an illness. Your body needs all its energy to recover from the illness. Also, be considerate to the other people in the gym. People in the weight room will be coming in close contact with both you and the equipment you use, making it very easy for the germs to be transmitted.