-
Notifications
You must be signed in to change notification settings - Fork 1
/
prc_assignment#4_vs-studio.c
70 lines (51 loc) · 2.3 KB
/
prc_assignment#4_vs-studio.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Write a C program to make a resume that takes input from the userand then displays the complete details.
// Resume should be formatted properly, using escape sequences
#include <stdio.h>
int main()
{
// Declares variables
int dd, mm, yyyy, cell1, cnic3;
long int cell2, cnic1, cnic2;
char name[30], Fname[30], address[50], gender[10], Cname[50], HSCyear[50], Sname[50], SSCyear[50];
// We will use fgets to store the input as gets is a dangerous function and can overload memory buffers
printf("Enter your Name : ");
fgets(name, 20, stdin);
printf("Enter your Father's name : ");
fgets(Fname, 20, stdin);
printf("Enter your Address : ");
fgets(address, 50, stdin);
printf("Enter your Gender ( Male/Female ): ");
fgets(gender, 10, stdin);
printf("Enter your College name / Board : ");
fgets(Cname, 50, stdin);
printf("Enter your HSC passing year ( month , year ) : ");
fgets(HSCyear, 50, stdin);
printf("Enter your School name / Board : ");
fgets(Sname, 50, stdin);
printf("Enter your SSC passing year ( month , year ) : ");
fgets(SSCyear, 50, stdin);
printf("Enter your Date of Birth ( dd-mm-yyyy ) : ");
scanf_s("%d-%d-%d", &dd, &mm, &yyyy);
printf("Enter your Cell-Phone Number ( 0300-1234567 ) : ");
scanf_s("%d-%ld", &cell1, &cell2);
printf("Enter your CNIC Number (XXXXX-XXXXXXX-X) : ");
scanf_s("%ld-%ld-%d", &cnic1, &cnic2, &cnic3);
// Print Resume with user Input
printf("\n****************************RESUME****************************");
printf("\n******************************CV******************************");
printf("\n**************************************************************");
printf("\n==============================================================");
printf("\n\nName : %s", name);
printf("Father's Name : %s", Fname);
printf("Address : %s", address);
printf("Gender : %s", gender);
printf("College Name : %s", Cname);
printf("HSC passing year : %s", HSCyear);
printf("SSC passing year : %s", SSCyear);
printf("School Name : %s", Sname);
printf("Date of Birth : %d-%d-%d", dd, mm, yyyy);
printf("\nCell-Phone Number : %d-%ld", cell1, cell2);
printf("\nCNIC Number : %ld-%ld-%d", cnic1, cnic2, cnic3);
printf("\n\n==============================================================");
return 0;
}