#include <stdio.h>

int main()
{

struct brothers
{
int id;
int age ;
float salary;
};             /*** this is what makes this different    john, malcolm and richard are in next line.  ***/

struct brothers john , malcolm , richard ;

john.id = 1234;            /**             define john a variable of the type 2 ints and one float  ***/
john.age = 34;
john.salary =  12000;

malcolm.id = 1234;
malcolm.age = 34;
malcolm.salary =  12000;

richard.id = 1234;
richard.age = 34;
richard.salary =  12000;

printf(" the ages are %d and %d and %d  \n",john.age, malcolm.age, richard.age);

printf(" the ids are %d and %d and %d  \n",john.id, malcolm.id, richard.id);

printf(" the salarys are %d and %d and %d  \n",john.salary, malcolm.salary, richard.salary);


return 0;
}



Return to previous page