Main.cc: In function 'int main()': Main.cc:9:9: error: 'yd' was not declared in this scope yd++; ^ Main.cc:4:13: warning: unused variable 'y' [-Wunused-variable] int n,k,y=0; ^