Saturday, 30 August 2014

Write a c program by using structure to array


 c program by using structure to array



#include<stdio.h>
#include<string.h>
struct student
{
   int id;
 char name[20];
 float percentage;
};
  void main()
 {
    struct student record={0};
   record.id=1;
 strcpy(record.name,”xxxx”);
 record.percentage=86.5;
printf(“Id is:%d\n”,record.id);
printf(“Name is:%d\n”,record.name);
printf(“Percentage is:%d\n”,record.percentage);
}

No comments: