So I was writing this simple program to calculate the day of any date using the Gaussian algorithm found here.
#include
using namespace std;
Here
{int y=((year-1)%100);int c=(year-1)/100;}
you declare and initialize the variables y, c, but you don't used them at all before they run out of scope. That's why you get the unused message.
Later in the function, y, c are undeclared, because the declarations you made only hold inside the block they were made in (the block between the braces {...}).