SHARE
TWEET

Structure

a guest Jan 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. struct property
  3. {
  4.     char employeeName[50];
  5.     int employeeID;
  6.     float employeeSalary;
  7. };
  8. int main()
  9. {
  10.     int i;
  11.     struct property r[5];
  12.     strcpy(r[0].employeeName,"Saif");
  13.     r[0].employeeID=1;
  14.     r[0].employeeSalary=12369.26;
  15.     strcpy(r[1].employeeName,"Karimul");
  16.     r[1].employeeID=2;
  17.     r[1].employeeSalary=265469.26;
  18.     strcpy(r[2].employeeName,"Nizamur");
  19.     r[2].employeeID=3;
  20.     r[2].employeeSalary=12369.26;
  21.     strcpy(r[3].employeeName,"Rakib");
  22.      r[3].employeeID=4;
  23.     r[3].employeeSalary=13369.06;
  24.     strcpy(r[4].employeeName,"Shupty");
  25.     r[4].employeeID=5;
  26.     r[4].employeeSalary=205469.26;
  27.     for(i=0;i<5;i++)
  28.     {
  29.          printf("Information of Employee %d \n", i+1);
  30.          printf(" Name: %s \n", r[i].employeeName);
  31.          printf(" ID: %d \n", r[i].employeeID);
  32.          printf(" Salary: %f\n",r[i].employeeSalary);
  33.      }
  34.     return 0;
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top