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

Question

In C language

Magic Number Programming:
Magic program ask user to enter three integers by the user, the three integers represent left bound,
right bound and arbitrary digit 'm', where left bound is less than right bound. Program should print all
magic numbers in the given range that doesn't contain digit 'm'. The number is magic if its every digit is
larger than the sum of digits which are on the right side of that digit. For example, 94210 is magic
number because 1> 0, 2 > 1+0, 4>2+1+0, and 9 > 4+2+1+0.
Write a complete C program that Call only One Function (magic_numbers) that will print all magic
numbers excluding a given digit 'm' that also entered by user ?
Input Sample :
Enter Left bound: 740
Enter Right bound:850
Enter digit to exclude it:2
Output sample:
Magic Numbers in Range Left=740, Right=850 with exclude digit m= 2 are:
740 741 750 751 760 810 830 831 840 841 843 850
Your function prototype is like this:
void magic_numbers(int left, int right, int digit);
expand button
Transcribed Image Text:Magic Number Programming: Magic program ask user to enter three integers by the user, the three integers represent left bound, right bound and arbitrary digit 'm', where left bound is less than right bound. Program should print all magic numbers in the given range that doesn't contain digit 'm'. The number is magic if its every digit is larger than the sum of digits which are on the right side of that digit. For example, 94210 is magic number because 1> 0, 2 > 1+0, 4>2+1+0, and 9 > 4+2+1+0. Write a complete C program that Call only One Function (magic_numbers) that will print all magic numbers excluding a given digit 'm' that also entered by user ? Input Sample : Enter Left bound: 740 Enter Right bound:850 Enter digit to exclude it:2 Output sample: Magic Numbers in Range Left=740, Right=850 with exclude digit m= 2 are: 740 741 750 751 760 810 830 831 840 841 843 850 Your function prototype is like this: void magic_numbers(int left, int right, int digit);
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.
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