Contact Learn C
Copy

Program 196:Simple Structure

Program 196:
 
#include<stdio.h>
#include<string.h>
 struct Book{
  int id,price;
  char name[100];
 };
main()
{

  struct Book b;
  printf("Enter book id\n");
  scanf("%d",&b.id);
  printf("Enter book name\n");
  scanf("%s",&b.name);
    printf("Enter book price\n");
  scanf("%d",&b.price);
   
   printf("Book id=%d\n",b.id);
   printf("Book Name=%s\n",b.name);
   printf("Book Price=%d\n",b.price);

}


Explanation:

//Coming Soon...

Output:

Simle Structure







 
Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide