Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

write a c++ and python code for the questions below

 
Problem #1: Arithmetic
• Read 2 integers A, B and print based on following cases:
if both are odd print their product A*B
if both are even print their division A/B (float division / assume B != 0)
if the first is odd and the second is even then find their sum A+B
if the first is even and the second is odd then find their subtraction A-B
0
o
o
o
• Inputs ⇒ outputs
0 57 => 35
。
12 2 => 6
O
56 => 11
O
12 3 => 9
Problem #2: Sort 3 numbers
• Given 3 integers, sort (order) them in ascending order and print them..
Inputs ⇒ outputs
O 123
123
132
123
213 123
231 123
0312➡123
321 123
• Do you notice there are only 6 ways to permutate 3 numbers!
0
10
expand button
Transcribed Image Text:Problem #1: Arithmetic • Read 2 integers A, B and print based on following cases: if both are odd print their product A*B if both are even print their division A/B (float division / assume B != 0) if the first is odd and the second is even then find their sum A+B if the first is even and the second is odd then find their subtraction A-B 0 o o o • Inputs ⇒ outputs 0 57 => 35 。 12 2 => 6 O 56 => 11 O 12 3 => 9 Problem #2: Sort 3 numbers • Given 3 integers, sort (order) them in ascending order and print them.. Inputs ⇒ outputs O 123 123 132 123 213 123 231 123 0312➡123 321 123 • Do you notice there are only 6 ways to permutate 3 numbers! 0 10
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education