[ create a new paste ] login | about

Link: http://codepad.org/4T4Je9i1    [ raw code | output | fork ]

C, pasted on Nov 24:
#include <stdio.h>

struct Employee
{
   char ename[20];
   int ssn;
   float salary;
   struct date
       {
       int date;
       int month;
       int year; 
       }doj;
}emp = {"Pritesh",1000,1000.50,{22,6,1990}};

int main(int argc, char *argv[])
{
printf("\nEmployee Name   : %s",emp.ename);  
printf("\nEmployee SSN    : %d",emp.ssn);  
printf("\nEmployee Salary : %f",emp.salary);  
printf("\nEmployee DOJ    : %d/%d/%d", \
         emp.doj.date,emp.doj.month,emp.doj.year);  
    
return 0;
}


Output:
1
2
3
4
5

Employee Name   : Pritesh
Employee SSN    : 1000
Employee Salary : 1000.500000
Employee DOJ    : 22/6/1990


Create a new paste based on this one


Comments: