i have declared two functions of void type.lets one function calculates value of variable 'c' and other of variable 'y' and when i cout them it comes out to be correct within the function.now i want to declare another function that compares values of 'c' and 'y' and return 1 if c=y and return 0 otherwise.please help and also i m a beginner in c++.

Change the return type of each function to return the value of c and y, then in the third function you can get those values to compare them. Something like this:

int foo1()
{
   int c = 5;
   return c;
}

int foo2()
{
   int y = 0;
   return y;
}

int foo3()
{
   int c = foo1();
   int y = foo2();
   return c == y;  // returns either 1 or 0 (true or false)
}

return 1 if c=y and return 0 otherwise

for this , you need to declare a function of int return type.

function that compares values of 'c' and 'y'

just use == operator.

if(c==y)
return 1;
else
return 0;