|
#include<stdio.h>
#include<conio.h>
void main()
{
struct student
{
long int rollno;
char sex;
float height;
float weight;
};
struct student data;
struct student *ptr1;
ptr1 = &data;
clrscr();
printf("ENTER THE RECORD OF THE STUDENT :\n");
printf("Rollno = ");
scanf("%ld",&data.rollno);
printf("Sex = ");
scanf(" %c",&data.sex);
printf("Height = ");
scanf("%f",&data.height);
printf("Weight = ");
scanf("%f",&data.weight);
printf("THE ENTERED CONTENTS ARE :\n");
printf("\nRollno = %ld",(*ptr1).rollno);
printf("\nSex = %c",(*ptr1).sex);
printf("\nHeight = %f",(*ptr1).height);
printf("\nWeight = %f",(*ptr1).weight);
getch();
}
|