Main.cc: In function 'int main()': Main.cc:7:5: error: 'j' was not declared in this scope j=0; ^ Main.cc:14:29: error: 'pow' was not declared in this scope ans=ans+a[i]*pow(2,i); ^