Friday, May 30, 2014

WRITE A PROGRAM TO READ AND PRINT THE VALUES OF A STRUCTURE VARIABLE USING STRUCTURE POINTER

#include<stdio.h>
#include<conio.h>
void main()
{
typedef struct student
{
int rollno;
char name[20];
}stud;
stud s1,*p1;
p1=&s1;
printf("enter the roll no and name\n");
scanf("%d%s",&(p1->rollno),p1->name);
printf("rollno->%d name->%s",p1->rollno,p1->name);
getch();
}

No comments:

Post a Comment