5. What will be the output of following code :
// Assume all header files are included
#include<stdio.h>
int main(void)
{
int a=435;
int b=432;
int res;
res=findrem(a,b);
int findrem(int x,int y)
{
return x%y;
}
printf("%d",res);
return 0;
}
A. -8
B. 8
C. 0
D. ERROR – Function subtract needs to be declared before main() or function prototype must be provided .
View Answer & Explanation
Ans. d
6. What will be the output of following code :
// Assume all header files are included
int main(void)
{
int k=7;
float l=7;
if(k==l)
{
printf("EQUAL\n");
}
else
{
printf("NOT EQUAL\n");
}
return 0;
}
A. EQUAL
B. NOT EQUAL
C. Error
D. None of these
View Answer & Explanation
Ans. a
Explanation : Perfect example of type promotion.
