C Program to illustrate STRUCTURE(DEFINITION AND USAGES)

Program By:-> Jayant Purohit
Hello Friends this is another C Program form my side.
This program illustrates the working of "Structures".
In this program the structure name "book" is used and it is assigned a value and 
then i have assigned values to the corresponding variables.


#include<conio.h>
#include<stdio.h>
void main()
{
struct book //defination of the structure
{
char name[20];
int page;
float price;
};
struct book b;
clrscr();
printf("\nPlease Enter the Name:->");
scanf("%s",&b.name);
printf("\nPlease Enter the Page:->");
scanf("%d",&b.page);
printf("\nPlease Enter the Price:->");
scanf("%f",&b.price);
printf("\nThe Values you supplied are:->");
printf("\n NAME:->%s",b.name);
printf("\n PAGE:->%d",b.page);
printf("\n PRICE:->%f",b.price);
getch();
}
void linkfloat()
{
float a=0,*b;
b=&a;
a=*b;
}





The Big question is that What the linkfloat function is doing here.
well for many of c compilers this code will generate linking error.
so that i have just added this function.
just enjoy the program and have a nice day.

if this post is helpful to you then plz. dn't forget to place comment on it.and share it tooo....

1 comment:

Please write your Views about this Post here:->;

Pageviews last month