Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  rom
Language: C/C++
Code:
#include<stdio.h>
#include<string.h>

struct student
{
int id;
char name[20];
float num;
};

int main()
{
    int i;
    struct student record[2];

record[0].id=1;
strcpy(record[0].name,"riya");
record[0].num=81.4;

record[1].id=2
strcpy(record[1].name,"payel");
record[1].num=70.65;

record[2].id=3;
strcpy(record[2].name,"subhra");
record[2].num=91.08;

for(i=0;i<3;i++)
     {
     printf("records of student:%dn",i+1);
     printf("id=n%d",record[i].id);
     printf("name=%s",record[i].name);     
     printf("num=n%f",record[i].num);
     }

return 0;
}

          
Comments: