Below is the program for if and else
#include<stdio.h>
#include<conio.h>
int main()
{
float a = 0.7; //a declared as float variable
if(a == 0.7) //why it takes only integral part of 0.7
{
printf("Hi");
}
else
{
printf("hello");
}
return 0;
}
Shouldn't this program display Hi
instead of hello
as 0.7 is equal to 0.7?
(I'm new to C programming)