I have 2 problems in C regarding floating point, please help :
Q1
Output of the following code- C.
main()
{
float a=0.7;
if(a<0.7)
printf("C");
else
printf("C++);
}
But if we change the if condition from a<0.7 to a<0.7f we get output- C++.
Q2
The following code gives runtime error- Floating point formats not linked. When does this error occur in a program.
main()
{
struct emp
{
char name[20];
float sal;
};
struct emp e[10];
int i;
for(i=0;i<=9;i++)
scanf("%s %f",e[i]name,&e[i].sal);
}