Question: #include #include int main() { printf(welcome to patient id); char Id[20]; char age[30]; char sex[40]; char PhoneNo[30]; int d; printf(Welcome to Patient ID regestration! );
#include
int main() { printf("welcome to patient id"); char Id[20]; char age[30]; char sex[40]; char PhoneNo[30];
int d;
printf("Welcome to Patient ID regestration! "); FILE*fptr; int choice; for(d=1;d<=15;d++) { printf("Are you regestered? "); printf(" Enter 1 If You Are Not Regestered!! "); printf(" Enter 2 to Display vaccine Regestered Information! "); printf(" Enter 3 to Save regestered vaccine Information in a file "); printf(" Enter 4 If you are already regestered!!! "); printf(" type any other Char to exit ");
scanf("%d",&choice); switch (choice) { case 1: printf("type your Id number: "); scanf("%s",Id); printf("Your PhoneNo if Available: "); scanf("%s",PhoneNo); printf("Your date of birth: "); scanf("%s",age); printf("your gender: "); scanf("%s",sex); case 2: printf(" Id number:%s ",Id); printf(" phone number:%s ",PhoneNo); printf(" birth:%s ",age); printf(" Gender:%s ",sex); case 3: fptr = fopen("C:\\chegg.txt","w"); fputs(Id,fptr); fprintf(fptr," "); fputs(PhoneNo,fptr); fprintf(fptr," "); fputs(sex,fptr); fprintf(fptr," "); fputs(age,fptr); fprintf(fptr," "); printf(" saved in file "); case 4: fptr = fopen("E:\\chegg.txt","r"); break; default: printf(" Exit from program "); d++; break; } } }
(this C programing is for vaccination id card, that I want to register information of 15 persons. can you add structure, array or multidimension array to my program to make it more richer, but please do not change the idea or information's.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
