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.o The error:
bash: ./main: No such file or directory Error when 'main.o' is used:
bash: ./main.o: Permission denied I am using Ubuntu 16.04 LTS.
01 Answer
g++ -Wall -Wextra -Werror main.cpp -o main Don't use the -c flag if you want to create an executable.
./main If you press Tab it will autocomplete.
2