20120113

Program in C to learn structures in C

//========================
//Program in C to learn structures in C,struct1.c
//========================

#include<stdio.h>
int main()
{
        struct book
        {
        char title;
        int page;
        float price;
        };
        struct book b1,b2,b3;
        printf("\n Enter the title, page and price for the first book \n");
        scanf("%c  %d  %f",&b1.title, &b1.page, &b1.price);
        printf("\n Details of first book are: %c %d %f \n",b1.title,b1.page,b1.price);

return 0;
}
Previous                             Home                               Next

No comments:

Post a Comment