About us

C Program for illustrating the structure within function

C Program for illustrating the structure within function


c-program-illustrating-structure-within-function

#include<stdio.h>
#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

Enter the Detail of Student:
Student Roll No.: 101
Student Name: Dren

You have Entered
Student Roll No.: 101
Student Name: Dren



------------------------------------------------------------------------------------------------------------

You can also visit:-