second program, have to give compilation error due to demo() doesn't declare before it's calling.
some of the compilers ( but not all ), by default assign int as return type but your original definition have void as return type., in this case also, it produce compilation error.