From 209b8a4c4a0ec8effdb8cb390fbe6598a64b983f Mon Sep 17 00:00:00 2001 From: HarleenWadhwa Date: Fri, 5 Oct 2018 07:15:47 -0700 Subject: [PATCH 1/2] add this --- C/14_cProgramming.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C/14_cProgramming.c b/C/14_cProgramming.c index 9a0a134..a29b7e1 100644 --- a/C/14_cProgramming.c +++ b/C/14_cProgramming.c @@ -9,9 +9,12 @@ int main() { float age1, age2, age3, average; - age1 = age2 = 4.0; - printf("Enter your age\n"); + printf("Enter your age of 1st person\n"); + scanf("%f", &age1); + printf("Enter your age of 2nd person\n"); + scanf("%f", &age2); + printf("Enter your age of 3rd person\n"); scanf("%f", &age3); average = (age1 + age2 + age3) / 3; From da45d94c51a8cb16bb39041ada8cf16badedf007 Mon Sep 17 00:00:00 2001 From: HarleenWadhwa Date: Fri, 5 Oct 2018 07:29:30 -0700 Subject: [PATCH 2/2] some change --- C/07_cProgramming.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C/07_cProgramming.c b/C/07_cProgramming.c index 0b06534..456970e 100644 --- a/C/07_cProgramming.c +++ b/C/07_cProgramming.c @@ -7,7 +7,8 @@ int main() { int currentYear; int birthYear; - currentYear = 2014; + printf("Enter Current Year"); + scanf("%d",¤tYear); birthYear = 1987; age = (currentYear - birthYear);