The number of chocolates that John is losing per day is x. Whereas, the number of chocolates that Joey is gaining per day is y. Currently, the number of chocolates that John and Joey contains is a and b respectively. You are required to calculate the number of chocolates that Joey has when John does not contain any chocolates. Note: It is guaranteed that John always loses all the chocolates (a % x = 0)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

Complete the c program

CodeChum
(2) Facebook
(3019) codechum king
A app.codechum.com/student/answer/14405/question/4
Time Left:
+ Back to Home
Overall Score
2:07:26:40
main.c
4. Number of
Chocolates
1
#include<stdio.h>
#include<math.h>
by Jemar Jude Maranga
int main()
{
int a,b,x,y;Numchoco
scanf("%d", a,b,x,y);
3.
4
The number of chocolates that John is losing
per day is x. Whereas, the number of
6
chocolates that Joey is gaining per day is y.
7
Currently,
number of chocolates that
8
Numcho co=a*b*x*y;
John and Joey contains is a and b
9.
10
respectively. You are required to calculate
the number of chocolates that Joey has
11
when John does not contain any chocolates.
12
}
Note: It is guaranteed that John always loses
all the chocolates (a % x = 0)
Input Format
A single line containing the values of a, b, x,
and y respectively.
Input Sample
100 10-5 100
Output Format
Custom Input
Output
Test C
A single integer denoting the number of
O Test Case l
chocolates that Joey has.
Output Sample
Test Case 2
Score: 0/15
= Overview
4/7
Transcribed Image Text:CodeChum (2) Facebook (3019) codechum king A app.codechum.com/student/answer/14405/question/4 Time Left: + Back to Home Overall Score 2:07:26:40 main.c 4. Number of Chocolates 1 #include<stdio.h> #include<math.h> by Jemar Jude Maranga int main() { int a,b,x,y;Numchoco scanf("%d", a,b,x,y); 3. 4 The number of chocolates that John is losing per day is x. Whereas, the number of 6 chocolates that Joey is gaining per day is y. 7 Currently, number of chocolates that 8 Numcho co=a*b*x*y; John and Joey contains is a and b 9. 10 respectively. You are required to calculate the number of chocolates that Joey has 11 when John does not contain any chocolates. 12 } Note: It is guaranteed that John always loses all the chocolates (a % x = 0) Input Format A single line containing the values of a, b, x, and y respectively. Input Sample 100 10-5 100 Output Format Custom Input Output Test C A single integer denoting the number of O Test Case l chocolates that Joey has. Output Sample Test Case 2 Score: 0/15 = Overview 4/7
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Structure chart
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage