#include<stdio.h>
#include<conio.h>
  typedef struct
{
  int rno;
  char name[10];
  float marks;
}stu;
 stu stu3;
 void getf(stu * stutmp);
 void show(stu * stutmp);
 void main()
{
 clrscr();
 getf(&stu3);
 show(&stu3);
 getch();
}
  void getf(stu *stutmp)
 {
  scanf(" %d",&stutmp->rno);
  printf("%d\n",stutmp->rno);
  scanf(" %s",stutmp->name);
  printf("%s\n",stutmp->name);
  scanf(" %f",&stutmp->marks);
  printf("%f\n",stutmp->marks);
  getch();
 }
 void show(stu * stutmp)
 {
  printf("Name: %s\n",stutmp->name);
  printf("RNO: %d\n",stutmp->rno);
  printf("MARJKS: %f\n",stutmp->marks);
 }

SUMMARY: Some compilers for small machines, including Turbo C (and Ritchie's original PDP-11 compiler), leave out certain floating point support if it looks like it will not be needed Read this FAQ - http://c-faq.com/fp/fpnotlinked.html

The program needs the floating-point library, but the library was not linked to the program.
One of the following may have occurred:

  1. The program was compiled or linked with an option (such as /FPi87) that required a coprocessor, but the program was run on a machine that did not have a coprocessor installed.
  2. A format string for a printf or scanf function contained a floating-point format specification, and the program did not contain any floating-point values or variables.
  3. The compiler minimizes a program's size by loading floating- point support only when necessary. The compiler cannot detect floating-point format specifications in format strings, so it does not load the necessary floating-point routines.
  4. Use a floating-point argument to correspond to the floating-point format specification, or perform a floating-point assignment elsewhere in the program. This causes floating-point support to be loaded.

Read an article posted by Siddant3s - http://siddhant3s.googlepages.com/how_to_tell_rusted_cpp.html

commented: Out of all the times I've been to that FAQ, I never noticed this one there. +24

Hey thanks buddy...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.