finclude 2 PROGRAM 24 3 int main() 25 case 2: 4 printf("\n2. SUBTRACTION\n"); printf(" printf(" ANs = +d - +d\n", B, A); int A = 10; int B = 15; int ANS = 0; int choice; printf("Basic Calculation\nGivens: "); printf("A = 10 || B = 15\n\n"); printf("Choices:\n"); printf("1. Addition: add A and B\n"); printf("2. Subtraction: subtract A from B\n"); printf("3. Addition and Subtraction\n\n"); printf("Enter choice: "); scanf ("d", &choice); 26 5 27 ANS = B - A\n"); 6 28 29 ANS = B-A; 8. printf(" ANS = $d\n", ANS); break; 30 31 10 32 11 33 case 3: 12 printf("\n3. ADDITION printf(" printf(" printf(" int ANS1 = A+B; 34 SUBTRACTION\n"); 13 35 ANS = A + B ANS = B - A\n"); 14 ANS = id + $d ||", A, B); ANS = d - $d\n", B, A); 36 15 switch (choice) 37 16 38 17 case 1: 39 printf("\nl. ADDITION\n"); printf(" printf(" int ANS2 = B-A; printf(" printf(" ANS = sd\n", ANS2); 18 II", ANS1); 40 ANS = td 19 ANS = A + B\n"); 41 20 ANS = sd + $d\n", A, B); break; 42 21 int ANS = A+B; 43 22 printf(" ANS = sd\n", ANS); 44 return 0; 23 break; 45 Basic Calculation Givens: A - 10 || B - 15 Basic Calculation Givens: A - 10 || B - 15 Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B 3. Addition and Subtraction CASE 1 CASE 3 OUTPUT/s Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B 3. Addition and Subtraction Enter choice: 1 Basic Calculation Givens: A - 10 || B - 15 1. ADDITION Enter choice: 3 ANS - A + B CASE 2 ANS - 10 + 15 Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B execu 3. Addition and Subtraction 3. ADDITION || ii ANS - B - A SUBTRACTION ANS - 25 ANS - A + B ANS = 10 + 15 || ANS = 15 - 10 Process returned e (®x®) Press any key to continue. ANS = 25 ii ANS - 5 Process returned e (8x8) Press any key to continue. Enter choice: 2 execution time : 0.524 s 2. SUBTRACTION ANS - B - A ANS - 15 - 10 ANS = 5 Process returned e (8x®) execution time : 0.685 s Press any key to continue. --- -
finclude 2 PROGRAM 24 3 int main() 25 case 2: 4 printf("\n2. SUBTRACTION\n"); printf(" printf(" ANs = +d - +d\n", B, A); int A = 10; int B = 15; int ANS = 0; int choice; printf("Basic Calculation\nGivens: "); printf("A = 10 || B = 15\n\n"); printf("Choices:\n"); printf("1. Addition: add A and B\n"); printf("2. Subtraction: subtract A from B\n"); printf("3. Addition and Subtraction\n\n"); printf("Enter choice: "); scanf ("d", &choice); 26 5 27 ANS = B - A\n"); 6 28 29 ANS = B-A; 8. printf(" ANS = $d\n", ANS); break; 30 31 10 32 11 33 case 3: 12 printf("\n3. ADDITION printf(" printf(" printf(" int ANS1 = A+B; 34 SUBTRACTION\n"); 13 35 ANS = A + B ANS = B - A\n"); 14 ANS = id + $d ||", A, B); ANS = d - $d\n", B, A); 36 15 switch (choice) 37 16 38 17 case 1: 39 printf("\nl. ADDITION\n"); printf(" printf(" int ANS2 = B-A; printf(" printf(" ANS = sd\n", ANS2); 18 II", ANS1); 40 ANS = td 19 ANS = A + B\n"); 41 20 ANS = sd + $d\n", A, B); break; 42 21 int ANS = A+B; 43 22 printf(" ANS = sd\n", ANS); 44 return 0; 23 break; 45 Basic Calculation Givens: A - 10 || B - 15 Basic Calculation Givens: A - 10 || B - 15 Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B 3. Addition and Subtraction CASE 1 CASE 3 OUTPUT/s Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B 3. Addition and Subtraction Enter choice: 1 Basic Calculation Givens: A - 10 || B - 15 1. ADDITION Enter choice: 3 ANS - A + B CASE 2 ANS - 10 + 15 Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B execu 3. Addition and Subtraction 3. ADDITION || ii ANS - B - A SUBTRACTION ANS - 25 ANS - A + B ANS = 10 + 15 || ANS = 15 - 10 Process returned e (®x®) Press any key to continue. ANS = 25 ii ANS - 5 Process returned e (8x8) Press any key to continue. Enter choice: 2 execution time : 0.524 s 2. SUBTRACTION ANS - B - A ANS - 15 - 10 ANS = 5 Process returned e (8x®) execution time : 0.685 s Press any key to continue. --- -
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
C
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY