0% found this document useful (0 votes)
26 views1 page

Struct

The document defines a student structure with fields for name, ID number, age, section, address, and pincode. It then declares an array of 10 student structures and uses a for loop to input data for the first 2 students and output the stored data.

Uploaded by

SivaRaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Struct

The document defines a student structure with fields for name, ID number, age, section, address, and pincode. It then declares an array of 10 student structures and uses a for loop to input data for the first 2 students and output the stored data.

Uploaded by

SivaRaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>

struct student {
char name[10];
int idno;
int age;
int sec;
char add[10];
int pin;
};
int main ( )
{
int i;
struct student stuarr [10] ;
printf (" \nname,\nidno,\nage,\nsec,\naddress,\npincode\n");
for(i=0;i<2;i++)
{

scanf("%s %d %d %d %s %d",stuarr[i] .name,&stuarr[i].idno,


&stuarr[i].sec,stuarr[i].add,stuarr[i].pin);
}
for(i=0;i<2;i++)
{
printf("%s %d %d %d %s %d \n",stuarr[i] .name,&stuarr[i].idno,
&stuarr[i].sec,stuarr[i].add,stuarr[i].pin);
printf ("\n");
}
}

You might also like