C Program for illustrating the structure within function
#include<conio.h>
void display(struct student);
struct student
{
int rollno;
char name[20];
}s1;
void main()
{
clrscr();
printf("Enter the Detail of Student:\n");
printf("Student Roll No.: ");
scanf("%d",&s1.rollno);
printf("Student Name: ");
scanf("%s",&s1.name);
display(s1);
getche();
}
void display(struct student d1)
{
printf("\nYou have Entered\n");
printf("Student Roll No.: %d\nStudent Name: %s\n",d1.rollno,d1.name);
}
OUTPUT
Student Roll No.: 101
Student Name: Dren
You have Entered
Student Roll No.: 101
Student Name: Dren
------------------------------------------------------------------------------------------------------------
You can also visit:-