answersLogoWhite

0

How do you create a structure?

User Avatar

Anonymous

16y ago
Updated: 8/17/2019

// We can create structure with struct keyword

struct abc

{

int roll_no;

int maths_marks;

int phy_marks;

int chem_marks;

};

int main(){

struct abc a;

a.roll_no = 1;

a.maths_marks = 90;

a.phy_marks = 72;

a.chem_marks = 80;

printf(" Roll no - %d\n, Maths Marks %d\n, Phy marks %d\n, Chem Marks %d\n", a.roll_no, a.maths_marks, a.phy_marks, a.chem_marks);

}

User Avatar

Wiki User

16y ago

What else can I help you with?