5 like 0 dislike

We need to build a program that performs this algorithm:

Step 1: Read the values a,b,c,.

Step 2: Inside the try block check the condition.

            a. if(a-b!=0) then calculate the value d=c/(a-b); and display.

            b. otherwise throw the exception.

Step 3: Catch the exception and display the appropriate message.

Step 4: Stop the program.

Example input:

5 5 8

Output:

Answer is infinite because a-b is:0

Example input 2:

5 7 8

Output:

Result is:-4

 Example input 3:

3 6 8

Output:

Result is:-2
[Normal] Coding (C++) - asked in Introduction to Computer Programming I (C) by (9.8k points)
Available when: Unlimited - Due to: Unlimited

retagged by | 7 views
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:108.162.221.93
©2016-2019

Related questions

6 like 0 dislike
2 answers
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (11.3k points)
Available when: Unlimited - Due to: Unlimited
| 32 views
8,033 questions
60,929 answers
33,033 comments
1,100 users