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();
}
Subscribe to:
Post Comments (Atom)
c programming process samples
ReplyDeleteProgram to print its Process ID, Parent Process ID and Group ID