C program to c++ 2PROGRAM243int main ()25case 2:4printf("\n2. SUBTRACTION\n");printf ("printf(" ANS = +d - td\n", B, A);ANS = B-A:printf(" ANS = sd\n", ANS);26int A = 10; int B = 15; int...


C program to c++


#include <stdio.h><br>2<br>PROGRAM<br>24<br>3<br>int main ()<br>25<br>case 2:<br>4<br>printf(

Extracted text: #include 2 PROGRAM 24 3 int main () 25 case 2: 4 printf("\n2. SUBTRACTION\n"); printf (" printf(" ANS = +d - td\n", B, A); ANS = B-A: printf(" ANS = sd\n", ANS); 26 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); 5 27 ANS = B - A\n"); 28 7 29 8. 30 31 break; 10 32 11 33 case 3: 12 printf("\n3. ADDITION printf (" printf(" printf(" int ANS1 = A+B; int ANS2 = B-A; 34 SUBTRACTION\n"); 13 35 ANS = A + B|| ANS = B - A\n"); 14 36 ANS = id + d ||", A, B); 15 switch (choice) ANS = id - sd\n", B, A); 37 ANS = sd- 16 38 17 case 1: 39 printf("\nl. ADDITION\n"); printf(" printf (" 18 printf(" printf(" 40 ANS = td |I", ANS1); 19 ANS = A + B\n"); 41 ANS = $d\n", ANS2); 20 ANS = d + d\n", A, B); 42 break; 21 int ANS = A+B; 43 22 printf (" ANS = d\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 ANS - A + B Enter choice: 3 CASE 2 Choices: 1. Addition: add A and B 2. Subtraction: subtract A from B execu 3. Addition and Subtraction ANS - 10 + 15 !! ANS = A + B ANS - 10 + 15 || || 3. ADDITION SUBTRACTION ANS - 25 ANS - B - A ANS = 15 - 10 Process returned 0 (exe) Press any key to continue. ANS - 25 ANS = 5 Process returned e (exe) 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 (exe) execution time : 0.685 s Press any key to continue.
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here