Skip to content

Commit 4e905a1

Browse files
authored
Merge pull request #3820 from NADIRHUSSAIN11/patch-1
update the result and exception error format.
2 parents 932c097 + e6f3260 commit 4e905a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/get-started/tutorial-console-cpp.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ If you build and run the code again at this point, it will still exit after aski
232232
{
233233
cin >> x >> oper >> y;
234234
result = c.Calculate(x, oper, y);
235-
cout << "Result is: " << result << endl;
235+
cout << "Result "<<"of "<< x << oper << y <<" is : "<< result << endl;
236236
}
237237

238238
return 0;
@@ -602,7 +602,7 @@ If you build and run the code again at this point, it will still exit after aski
602602
{
603603
cin >> x >> oper >> y;
604604
result = c.Calculate(x, oper, y);
605-
cout << "Result is: " << result << endl;
605+
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
606606
}
607607

608608
return 0;
@@ -716,13 +716,14 @@ Let's handle division by zero more gracefully, so a user can understand the prob
716716
if (oper == '/' && y == 0)
717717
{
718718
cout << "Division by 0 exception" << endl;
719+
cout << "Math error: Attempted to divide by Zero! "<<endl;
719720
continue;
720721
}
721722
else
722723
{
723724
result = c.Calculate(x, oper, y);
724725
}
725-
cout << "Result is: " << result << endl;
726+
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
726727
}
727728

728729
return 0;

0 commit comments

Comments
 (0)