How to increase efficiency of matrix operation in C?
I suggest dropping the floating point and doing it fixed point.  To do this I
would make a[][] of type int or short (depending upon the input
constraints) and instead of storing values x and x * 0.5, store 2x and x
respectively.  At the end of the summation you can then divide by 2 to get the
true result.

The only issue this raises is that of integer overflow.  You don't state any
numerical constraints but the fixed size arrays (2000x2000) suggest overflow
will not occur with long long.  Alternatively the summation itself could be
floating point while the array values remain integers.  I notice that your
current summation uses float which might well be slower than double.

Another minor point where you can improve the speed is in the input loop.  You
have the conditional

if(n!=1)
    a[i][i] = num*0.5;
else
    a[i][i] = num;


As the loop variable i goes from 0 to n, if n is 1 then the loop only
fills a[0][0] and so this conditional can be removed from the loop.  But if n
is small this will make little difference.