HOME

Thursday, March 19, 2015

C PROGRAM TO TAKE ROLL NO, NAME AND MARK OF STUDENT USING NESTED STRUCTURE

#include<stdio.h>
#include<conio.h>
struct student
{
    int roll;
    char name[20];
    struct marks
    {
        int mark;
    }b;
};
void main()
{
    struct student a;
    printf("enter the roll no, name and mark of student\n");
    scanf("%d%s%d",&a.roll,a.name,&a.b.mark);
    printf("the data you have entered are;\n");
    printf("roll no\tname\tmark\n");
    printf("%d\t%s\t%d",a.roll,a.name,a.b.mark);
}

No comments:

Post a Comment