What will be the output of the program? #include
int main()
{
float a=0.7;
if(a < 0.7f)
printf("C\n");
else
printf("C++\n");
return 0;
}
Correct Answer: C++
Explanation:
if(a < 0.7f) here a is a float variable and 0.7f is a float constant. The float variable a is not less than 0.7f float constant. But both are equal. Hence the if condition is failed and it goes to else it prints 'C++' Example:
Discussion & Comments