The code snippet:
#include <iostream>
using namespace std;
int main(){ unsigned int a, b, diff; cin>>a>>b; diff = a - b; if(diff % 10 == 9){ diff--; }else{ diff++; } cout<<diff; return 0;
}The command used to compile:
g++ -Wall -Wextra -Werror -c main.cpp -o main.oThe error:
bash: ./main: No such file or directoryError when 'main.o' is used:
bash: ./main.o: Permission deniedI am using Ubuntu 16.04 LTS.
01 Answer
g++ -Wall -Wextra -Werror main.cpp -o mainDon't use the -c flag if you want to create an executable.
./mainIf you press Tab it will autocomplete.
2