C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Point Out Errors (Q.No. 5)
5.
Point out the error in the 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[i].name, &e[i].sal);
return 0;
}
Answer: Option
Explanation:
At run time it will show an error then program will be terminated.
Sample output: Turbo C (Windows)
c:\>myprogram Sample 12.123 scanf : floating point formats not linked Abnormal program termination
Discussion:
27 comments Page 3 of 3.
Shivam said:
1 decade ago
Please tell me why this error occurs?
Sowmya said:
1 decade ago
But how does a linker error occur??
Shivani said:
10 years ago
It is also supported with turbo C.
Ram said:
1 decade ago
Hi preethi its linking error yaar.
Deepak Hirapur said:
10 years ago
It executed successfully in GCC.
Ratan Lal said:
9 years ago
In GCC it will run correctly.
Markpravo said:
1 decade ago
Floating format not linked ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers