HOME

Thursday, March 19, 2015

C PROGRAM TO ENTER NAME, ROLL NO AND MARK AND DISPLAY IT USING STRUCTURE

#include<stdio.h>
#include<conio.h>
struct student
    {
        char name[20];
        int roll;
        int mark;

    };
void main()
{
    struct student a;
        printf("enter the name, roll no and mark\n");
        scanf("%s%d%d",a.name,&a.roll,&a.mark);
        printf("the data you have entered are:\n");
        printf("name\troll\tmark\n");
        printf("%s\t%d\t%d",a.name,a.roll,a.mark);
}

No comments:

Post a Comment