The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Relevant Concepts: Branching and Loop structure , I need help to solve these two problems.Â
Â
Relevant Concepts:Branching and Loop structureProblem 1:Develop a C program that a) lets a user enter value of n, b) sums allpositive numbers from 100 – 499 (inclusive) that are divisible by n and display the sum,and c) display total numbers from 100 – 499 (inclusive) that are divisible by n.Sample code execution #1:Red entered by a userEnter value of n:10There are 40 values between 100-499 that are divisible by 10Sum of numbers between 100-499 that are divisible by 10 is 11800Press any key to continue . . .Sample code execution #2:Red entered by a userEnter value of n:23There are 17 values between 100-499 that are divisible by 23Sum of numbers between 100-499 that are divisible by 23 is 5083Press any key to continue . . .More Test cases:1) n = 540 (answer: 0 value and sum = 0)2) n = 1 (answer: 400 values and sum = 119800)3) n = 7(answer: 57 values and sum = 17157)Problem 2:Develop a C program that lets a user enter only a number between 1 and 9anddisplay the following output. Your program should make sure that a user entersonly a positive number between 1 and 9.See sample code execution below.Hint: nested loops should be used.Sample Code execution #2:Note:-5, 0, 8 are entered by a userSample Code execution #1:Note:10, -1, 32, -10, 3 are entered by a user
Attachments: