Write a program to illustrate the comparison of structure variables.

Struct class
{
   Int number;
   Char name[20];
   Float marks;
};
Main()
{
Int x;
Struct class std1={111,”rao”72.50};
Struct class std2={222,”reddy”,56.00};
Struct class std3;
Std3=std2;
X=((std3.number==std2.number)&&(std3.marks==std2.marks)) ?1:0;
If(x==1)
{
Printf(“\nstd2 and std3 are same \n\n”);
Printf(“%d %s %f \n”,std3.number,std3.name,std3.marks);
}
Else
Printf(“\nstd2 and std3 are different \n\n”);

}          

0 Comment "Write a program to illustrate the comparison of structure variables."

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

Loading...
இணைந்திருங்கள் 24 நேரமும்!! Like us on Facebook!)