Coding-
#include<stdio.h>
#include<conio.h>
struct student
{
int rollno;
char name[20];
int age;
};
struct student input studentdata();
void showstudentdata (struct student);
void main()
{
struct student s1;
clrscr();
s1=inputstudentdata();
showstudentdata(s1)
getch();
}
struct student inputstudentdata()
{
struct student s;
printf("Enter roll no,name and age");
scanf("%d",&s,roll no);
fflush (stdio);
gets(s.name);
scanf("%d",&s. age);
return(s);
}
void showstudentdata (structstudent ss);
{
printf("\n studentdata");
print("\n rollno =%d",ss.roll no);
printf("\n name=%s",ss.name);
printf("\n age=%d",ss.age);
}
OUTPUT-
Enter roll no,name and age 12345
Amar
19
student data
roll no =12345
name=Amar
age=19
#include<stdio.h>
#include<conio.h>
struct student
{
int rollno;
char name[20];
int age;
};
struct student input studentdata();
void showstudentdata (struct student);
void main()
{
struct student s1;
clrscr();
s1=inputstudentdata();
showstudentdata(s1)
getch();
}
struct student inputstudentdata()
{
struct student s;
printf("Enter roll no,name and age");
scanf("%d",&s,roll no);
fflush (stdio);
gets(s.name);
scanf("%d",&s. age);
return(s);
}
void showstudentdata (structstudent ss);
{
printf("\n studentdata");
print("\n rollno =%d",ss.roll no);
printf("\n name=%s",ss.name);
printf("\n age=%d",ss.age);
}
OUTPUT-
Enter roll no,name and age 12345
Amar
19
student data
roll no =12345
name=Amar
age=19
Comments
Post a Comment
Please Subscribe and Comments my blog site.