wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

What error are you likely to get when you run the following 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));
}

A
Suspicious pointer conversion
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
floating Point formats not linked
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Cannot use scanf() for structures
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Strings cannot be nested inside structures
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B floating Point formats not linked

The error is we likely to get when you run the following 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));
}

Output:-

Floating Point formats not linked.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
PN Junction
PHYSICS
Watch in App
Join BYJU'S Learning Program
CrossIcon