From 2e082453e7d7986fb61782e4a4234bddce985f3a Mon Sep 17 00:00:00 2001 From: Chandrima15 <108191552+Chandrima15@users.noreply.github.com> Date: Sun, 23 Oct 2022 09:08:59 +0530 Subject: [PATCH] Update Problem 8 Solution.cpp --- Problem 8 Solution.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Problem 8 Solution.cpp b/Problem 8 Solution.cpp index 93a4629..7e79978 100644 --- a/Problem 8 Solution.cpp +++ b/Problem 8 Solution.cpp @@ -3,17 +3,17 @@ #include int main () { - int c, g, h; + int v, g, h; printf ("Enter the gravity, g :"); scanf ("%d", &g); - printf ("Enter the velocity, c :"); - scanf ("%d", &c); - if (c>=1000 && c<=3000 && g>=1 && g<=10 && (c*c)%g==0) + printf ("Enter the velocity, v :"); + scanf ("%d", &v); + if (v>=1000 && v<=3000 && g>=1 && g<=10 && (v*v)%g==0) { - h=(c*c)/(2*g); + h=(v*v)/(2*g); printf ("%d", h); } else printf ("Out of range"); return 0; -} \ No newline at end of file +}