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
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
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
Related questions
Question
basic in c++ no function

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

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

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 3 steps with 6 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education