Person structure in C Programming

#include <stdio.h>
struct Person
{
    char *name;
    int age;
    double p_salary;
};
int main()
{
   struct Person p;
   p.name ="Mike";
   p.age = 35;
   p.p_salary = 55000.00;
   printf("Name: %s\n",p.name);
   printf("Age: %d\n",p.age);
   printf("Salary: %.2f\n",p.p_salary);

return 0;
}

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *