The specific part I do not understand is how the -a in the if statement changes -3 to 3. Can someone explain how the -a changes a = -3 to a = 3?
#include <iostream>
int main(){
signed a = -3;
if (a < 0){ std::cout << -a << std::endl; }
else { std::cout << a << std::endl; }
system("pause");
return 0;
}
Aucun commentaire:
Enregistrer un commentaire