Well the first couple of questions are OK, then you get this one badly wrong.
Code:
What is the output of the following program:
#include<stdio.h>
int main(){
for(int a=0; a<=3;a++);
printf("%d",a);
return 0;
}
Wrong method for loop.
Wrong place for semicolon so compile error.
4
Program will not execute.
The correct answer is that it won't compile.
Code:
$ gcc -Wall -std=c99 bar.c
bar.c: In function ‘main’:
bar.c:4:15: error: ‘a’ undeclared (first use in this function)
bar.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
The reason being that the scope of a ends with the stray ; at the end of the loop, so there is no a in scope to printf.
The question on rounding floats makes no account of negative numbers, or the possibility of numeric overflow.
The question on "what does malloc do" is wrong on so many levels.