C
C learner
Point out the error in the following program.
#include<stdio.h>
int main()
{
struct emp
{
char name[20];
float sal;
};
struct emp e[10];
int i;
for(i=0; i<=9; i++)
scanf("%s %f", e.name, &e.sal);
return 0;
}
[A]. Suspicious pointer conversion
.
Floating point formats not linked (Run time error) @
[C]. Cannot use scanf() for structures
[D]. Strings cannot be nested inside structures
Answere is B
My question is what is Floatin point linkage and how it is applicable here.
Please elaborate.
#include<stdio.h>
int main()
{
struct emp
{
char name[20];
float sal;
};
struct emp e[10];
int i;
for(i=0; i<=9; i++)
scanf("%s %f", e.name, &e.sal);
return 0;
}
[A]. Suspicious pointer conversion
.
Floating point formats not linked (Run time error) @
[C]. Cannot use scanf() for structures
[D]. Strings cannot be nested inside structures
Answere is B
My question is what is Floatin point linkage and how it is applicable here.
Please elaborate.