Basic Programs

If Else based Programs

Loop Based Programs

Array Based Programs

String Programs

Function Programs

Pointers Programs

Structure & File Handling Programs

Data Structure Programs

Structure and File Handling programs

Array of structure program

#include <stdio.h>
#include <conio.h>
void main()
{
     struct book
     {
         int pages;
         float mrp; 
      };
     
     struct book b[5];
      int i=0; //how to take input in structure variable.
         for(i=0;i<5;i++){
         scanf("%d", &b[i].pages);
         scanf("%f", &b[i].mrp);
         }
//how to print structure variable using array.
      printf("details for books\n");
    for(i=0;i<5;i++){     

            printf("pages= %d price=%f\n" , b[i].pages, b[i].mrp);          

      }

}

Output of the above program is as following.

Video/ C Introduction

Watch video in full size
Wordpress Social Share Plugin powered by Ultimatelysocial