#include<stdio.h>
#include<conio.h>
int main()
{
float a=0.7;
if(a<0.7)
printf("C");
else
printf("C++");
getch();
return 0;
}
The above code prints 'C'.
Whereas the following two codes prints 'C++'. Why is that?
#include<stdio.h>
#include<conio.h>
int main()
{
float a=0.7;
if(a>0.7)
printf("C");
else
printf("C++");
getch();
return 0;
}
#include<stdio.h>
#include<conio.h>
int main()
{
float a=0.7;
if(a<0.7f)
printf("C");
else
printf("C++");
getch();
return 0;
}