Monday, February 23, 2009

structures in c program 1

#include #include main(void) { struct employee { int id; char name[32]; }; struct employee info={1,"niraj"}; printf("\nhere is the sample:"); printf("\nemp name: %s",info.name); printf("\nemp id #:%04d\n\n",info.id); printf("\nwhat is ur name?:"); gets(info.name); printf("what is ur #id no"); scanf("%d",&info.id); printf("\nhere is entered data:"); printf("\nemp name: %s",info.name); printf("\nemp id #:%04d\n\n",info.id); getch(); }

1 comment: