why it shows undeclared variable although it is declared with int?
I am trying this code to calculated how many coins change are back to a costumer, for 25 , 10 , 5 and 1 cents...whatever the function but the weird thing it shows undeclared variable for back,back2,back3, back4 alothough I declared them all with int, and it shows me unused for them all although I use them in the summation which is backk. include <iostream> using namespace std; int main() { int x = 61 / 25; if (x>0) int back=x; int n=61%25; int c=n/10; if (c>0) int back2=c; int d=n%10; int f=d/5; if (f>0) int back3=f; int h=f%5; int back4=h; int backk= back + back2 +back3 + back4; cout<<x<<endl<<n<<endl<<c<<endl<<d<<endl<<f<<endl<<h<<endl<<backk; return 0; }