path2code.com/p2c/suser/question/read.php?testid=ZaZTrLMI7CVIhDCZnJky3m.G5Wo9hf44FxHP97o0xjM-&qid=xXCvti53KVURFypz6xYJLg- نموذج بدون عنوان - نصانج.. Google a O YouTube O Inbox • Direct O The first line is a single character representing the user's choice. The second input depends on the entered character, see samples below. E Output Format Print out the appropriate result message. Sample #1 Innut

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

code in c++

x Menu Path2Code
x (3) Facebook
x My Tutoring | bartleby
path2code.com/p2c/suser/question/read.php?testid=ZaZTrLMi7CVIhDCZnJky3m.G5Wo9hf44FxHP9700xjM-&qid=xXCvti53KVURFypz6xYJLg--
قائمة القراءة
= نموذج بدون عنوان - نماذج. ..
Google bils O
YouTube O
Inbox • Direct O
Gmail M
التطبيقات
The first line is a single character representing the user's choice.
The second input depends on the entered character, see samples below.
E Output Format
Print out the appropriate result message.
O Sample #1
Input
57
Output
Result: 8 6
Sample #2
Input
68468864844752
Output
Diff: 4
O Sample #3
Input
03:46 P
5/9/2021
Transcribed Image Text:x Menu Path2Code x (3) Facebook x My Tutoring | bartleby path2code.com/p2c/suser/question/read.php?testid=ZaZTrLMi7CVIhDCZnJky3m.G5Wo9hf44FxHP9700xjM-&qid=xXCvti53KVURFypz6xYJLg-- قائمة القراءة = نموذج بدون عنوان - نماذج. .. Google bils O YouTube O Inbox • Direct O Gmail M التطبيقات The first line is a single character representing the user's choice. The second input depends on the entered character, see samples below. E Output Format Print out the appropriate result message. O Sample #1 Input 57 Output Result: 8 6 Sample #2 Input 68468864844752 Output Diff: 4 O Sample #3 Input 03:46 P 5/9/2021
x Menu Path2Code
x (4) Facebook
x My Tutoring | bartleby
path2code.com/p2c/suser/question/read.php?testid=ZaZTrLMi7CVIhDCZnJky3m.G5Wo9hf44FxHP97o0xjM-&qid=xXCvti53KVURFypz6xYJLg--
قائمة القراءة
= نموذج بدون عنوان - نماذج. ..
Google ails O
YouTube D
Inbox • Direct O
Gmail M
التطبيقات
O Challenge task
Write a C++program that reads user's choice as single character then do the following:
• If the user entered (A), your program should read 10 integer numbers, then find and print the sum of the odd numbers.
• If the user entered (B), your program should read two integer numbers, add one to each of them, swap their values, and print them after
swapping.
• If the user entered (C), your program should read a long positive number, and display the positive difference between the first and last digits
(the positive difference between the most right digit and the most left digit)
i.e.
If the number is 5635634, the program should display 1 (5-4=1).
If the number is 3635637, the program should display 4 (7-3=4).
• If the user entered any other character as a choice, then your program should display the following pattern.
12345
1234
123
12
1
03:46 P
5/9/2021
ull
Transcribed Image Text:x Menu Path2Code x (4) Facebook x My Tutoring | bartleby path2code.com/p2c/suser/question/read.php?testid=ZaZTrLMi7CVIhDCZnJky3m.G5Wo9hf44FxHP97o0xjM-&qid=xXCvti53KVURFypz6xYJLg-- قائمة القراءة = نموذج بدون عنوان - نماذج. .. Google ails O YouTube D Inbox • Direct O Gmail M التطبيقات O Challenge task Write a C++program that reads user's choice as single character then do the following: • If the user entered (A), your program should read 10 integer numbers, then find and print the sum of the odd numbers. • If the user entered (B), your program should read two integer numbers, add one to each of them, swap their values, and print them after swapping. • If the user entered (C), your program should read a long positive number, and display the positive difference between the first and last digits (the positive difference between the most right digit and the most left digit) i.e. If the number is 5635634, the program should display 1 (5-4=1). If the number is 3635637, the program should display 4 (7-3=4). • If the user entered any other character as a choice, then your program should display the following pattern. 12345 1234 123 12 1 03:46 P 5/9/2021 ull
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education