An electronic device is provided. The electronic device includes: a first body; a second body being folded or unfolded with respect to the first body; a first sensor sensing a signal according to the folding/unfolding of the second body; a second sensor sensing a signal according to the folding/unfolding of the second body, in a position different from the first sensor; and a processor operatively connected with the first sensor and the second sensor. The processor determines a folded/unfolded state of the second body in accordance with the sensing signals of the first sensor and second sensor.