Store data using structure in C
Store data using structure in C

Example of Store data using structure with Syntax

  • Post author:
  • Post category:C

Store Data Using Structure

Store data using structure in C, In this program today we learn about storing in C using STRUCT (Structure) through a given Program.

Thank you for reading this post, don't forget to subscribe!

Syntax of Using Structure

typedef struct Studen

{

char sName[20];

int sID;

}

student;

Example of Storing data in Struc

#include <stdio.h>

#include <string.h>
typedef struct Studen
{
char sName[20];
int sID;

} student;

int main()
{
student s;
strcpy(s.sName,"SONY");
s.sID=15;

printf("Student Name : %s\nStudent ID : %d",s.sName,s.sID);

return 0;
}

Student Name : SONY

Student ID :15

Store data using structure in C

Saurabh Nissa

This is SaurabhNissa, Owner of Thesmolt.com I'm Graduated from Magadh University in 2019 with 75%. Currently, I'm working on my Personal educational website for teaching Programming language free of Coast, and want to provide a Full setup for Specially BCA student