Sunday, August 21, 2011

Program to pass a structure variable to Function.

//Program to pass a structure variable to Function.
#include<stdio.h>
#include<conio.h>
 struct student
 {
  int rn;
  char name[20];
 }s;
 void main()
 {
 void display(struct student m);
 printf("Enter the rollno and name of student");
 scanf("%d%s",&s.rn,&s.name);
 display(s);
 getch();
}
void display(struct student m)
{
printf("%d %s",m.rn,m.name);
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More