conditional expression behaviour for assignment statement in c
===

In the first program below there is no error.But for the second program there is an error.
Why is that so?

First program:

    #include<stdio.h>
    void main()
    {
    int k=8;
    int m=7;
    k<m?k=k+1:m+1;
    printf("%d",k);
    }


Second program:

    #include<stdio.h>
    void main()
    {
    int k=8;
    int m=7;
    k<m?k=k+1:m=m+1;
    printf("%d",k);
    }