Monday, February 15, 2010

What is the output of following program?

2) void squared(void *nbr)
{
*nbr *= *nbr;
}

int main()
{
int a = 2;
squared((void *)a);
return 0;
}

Choice:
a)Error
b)4
c)4 with warning
d)2
e)Segmentation Fault

No comments: