struct student \\ A
{
char name[30]; \\ B
float marks; \\ C
} student1, student2; \\ D
main ( )
{
struct student student3; \\ E
char s1[30]; \\ F
float f; \\ G
scanf (“%s”, name); \\ H
scanf (“ %f”, & f); \\ I
student1.name = s1; \\ J
student2.marks = f; \\ K
printf (“ Name is %s \n”, student1.name); \\ L
printf (“ Marks are %f \n”, student2.marks); \\ M
}
----------------------------------------------------------
Struct address \\ A
{
plot char [30], struc char[30];
city char[30]
}
struct student \\ B
{
name char[30];
marks float;
struct address adr; \\ C
}
main ( )
{
struct student student1; \\ D
struct student class[20]; \\ E
class[1].marks = 70; \\ F
class[1].name = “ Anil “;
class[1].adr.plot = “7 ”; \\ G
class[1].adr.street = “ Mg Road”;
class[1].adr.city = “mumbai”;
printf( “ Marks are %d\n”, class[1].marks);
printf( “ name are %s\n”, class[1].name);
printf( “ adr.plot is %s\n”, class[1].adr.plot);
printf( “ adr.street is %s\n”, class[1].adr.stret);
printf( “ adr.city is %s\n”, class[1].adr.city);
}
------------------------------------------------------
struct student
{
name char[30];
marks float;
}
main ( )
{
struct student student1;
student1 = read_student ( )
print_student( student1);
read_student_p(student1);
print_student (student1);
}
struct student read_student( ) \\ A
{
struct student student2;
gets(student2.name);
scanf(“%d”,&student2.marks);
return (student2);
}
void print_student (struct student student2) \\ B
{
printf( “name is %s\n”, student2.name);
printf( “marks are%d\n”, student2.marks);
}
void read_student_p(struct student student2) \\ C
{
gets(student2.name);
scanf(“%d”,&student2.marks);
}
-----------------------------------------------------------
struct student \\ A
{
char name[30]; \\ B
float marks; \\ C
} ; \\ D
main ( )
{
struct student *student1; \\ E
struct student student2; \\ F
char s1[30];
float f;
student1 = &student2; \\ G
scanf (“%s”, name); \\ H
scanf (“ %f”, & f); \\ I
*student1.name = s1; \\ J student1-> name = f;
*student2.marks = f; \\ K student1-> marks = s1;
printf (“ Name is %s \n”, *student1.name); \\ L
printf (“ Marks are %f \n”, *student2.marks); \\ M
}
-----------------------------------------------------------------
{
char name[30]; \\ B
float marks; \\ C
} student1, student2; \\ D
main ( )
{
struct student student3; \\ E
char s1[30]; \\ F
float f; \\ G
scanf (“%s”, name); \\ H
scanf (“ %f”, & f); \\ I
student1.name = s1; \\ J
student2.marks = f; \\ K
printf (“ Name is %s \n”, student1.name); \\ L
printf (“ Marks are %f \n”, student2.marks); \\ M
}
----------------------------------------------------------
Struct address \\ A
{
plot char [30], struc char[30];
city char[30]
}
struct student \\ B
{
name char[30];
marks float;
struct address adr; \\ C
}
main ( )
{
struct student student1; \\ D
struct student class[20]; \\ E
class[1].marks = 70; \\ F
class[1].name = “ Anil “;
class[1].adr.plot = “7 ”; \\ G
class[1].adr.street = “ Mg Road”;
class[1].adr.city = “mumbai”;
printf( “ Marks are %d\n”, class[1].marks);
printf( “ name are %s\n”, class[1].name);
printf( “ adr.plot is %s\n”, class[1].adr.plot);
printf( “ adr.street is %s\n”, class[1].adr.stret);
printf( “ adr.city is %s\n”, class[1].adr.city);
}
------------------------------------------------------
struct student
{
name char[30];
marks float;
}
main ( )
{
struct student student1;
student1 = read_student ( )
print_student( student1);
read_student_p(student1);
print_student (student1);
}
struct student read_student( ) \\ A
{
struct student student2;
gets(student2.name);
scanf(“%d”,&student2.marks);
return (student2);
}
void print_student (struct student student2) \\ B
{
printf( “name is %s\n”, student2.name);
printf( “marks are%d\n”, student2.marks);
}
void read_student_p(struct student student2) \\ C
{
gets(student2.name);
scanf(“%d”,&student2.marks);
}
-----------------------------------------------------------
struct student \\ A
{
char name[30]; \\ B
float marks; \\ C
} ; \\ D
main ( )
{
struct student *student1; \\ E
struct student student2; \\ F
char s1[30];
float f;
student1 = &student2; \\ G
scanf (“%s”, name); \\ H
scanf (“ %f”, & f); \\ I
*student1.name = s1; \\ J student1-> name = f;
*student2.marks = f; \\ K student1-> marks = s1;
printf (“ Name is %s \n”, *student1.name); \\ L
printf (“ Marks are %f \n”, *student2.marks); \\ M
}
-----------------------------------------------------------------
0 Comments