Please help me to understand the logic behind the assignment of variables : I am a newbie,I want to explore all the methods through which I can assign an operator
I tried many, in some I got error and some succeed,I am sharing the failed methods please help me with their explanations and logic
Method 1

    #include <stdio.h>
    int main(void) {
    int a=b=c=6;
    printf("%d\n",a);
    printf("%d\n",b);
    printf("%d\n",c);
    return 0;
    }
It displays an error:

    prog.c:5:7: error: ‘b’ undeclared (first use in this function)
    int a=b=c=6;
           ^
    prog.c:5:7: note: each undeclared identifier is reported only once for             
    each function it appears in
    prog.c:5:9: error: ‘c’ undeclared (first use in this function)
    int a=b=c=6;
             ^

Method 2:

    #include <stdio.h>
    int main(void) {
    int a,b,c;
    printf("%d\n",a);
    printf("%d\n",b);
    printf("%d\n",c);
    return 0;
    }

My output is

    0
    0
    0

Is this due to return 0?
Also , please add examples for better understanding, I will be thankful to you.
