Assignment
You want to mail out the automation foe the new optimizing ForTran compiler to your clients. The client information is in the following format: Client number (integer) Name (30 char) City (20 char) Street (80 char at the most 4 lines & lines delimited by $ sign) State (20 char) Pincode (15 char) #include <stdio.h> #include <stdlib.h> Typedef struct{ Char name [30],city[20],street[80],state[50],pincode[10]; Int number; ; } employee; Int main() { Int I,n; Printf(“enter the number of employees =”); Scanf(“%d”,&n); Employee employees[n]; Printf(“enter %d employee details \n\ n”,n); For(i=0; i<n; i++) { Print f(“employee %d: - \ n”,i+1); Printf(“name:”); Scanf(“%s”,employees[i].name);
Printf(“employee number:”); Scanf(“%d”,&employees[i].number); Printf(“city:”); Scanf(“%s”,employees[i].city); Printf(“street:”); Scanf(“%s”,employees[i].street); Printf(“state:”); Scanf(“%s”,employees[i].state); Printf(“pincode:”); Scanf(“%s”,employees[i].pincode); Printf(“ \ n”); } Printf(“ --------------------all emlpoyees details-------------------\ n”); For(i=0; i<n; i++) { Printf(“number \ t:”); Printf(“%d \n ”,employees[i].number); Printf(“name \ t:”); Printf(“%s \ n”,employees[i].name); Printf(“city \ t:”); Printf(“%s \ n”,employees[i].city); Printf(“street \ t:”); Printf(“%s \ n”,employees[i].street); Printf(“state \ t:”); Printf(“%s \ n”,employees[i].state); P rintf(“pincode \ t:”); Printf(“%s \ n”,employees[i].pincode); Printf(“ \ n”); }
Return 0; }
Structured Employee Data Management in C
Please or to post comments