Contact Learn C
Copy Program Share Program

Program 199:Structure using Functions

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

  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);
  bookprint(b);
}

void bookprint(struct Book b1)
{
    
   printf("Book id=%d\n",b1.id);
   printf("Book Name=%s\n",b1.name);
   printf("Book Price=%d\n",b1.price);
}


Explanation:

//Coming Soon...

Output:

Structure using Functions







 

Download App and Learn when ever you want

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