What is the maximum number of employees among whom 510 sandwiches and
650 candies can be distributed such that each employee gets the same number of
sandwiches and the same number of candies?
Answers
Answered by
7
#include<iostream>
using namespace std;
int main()
{
int sandwiches,candies,employees=0;
cout<<"Enter no. of sandwiches : ";
cin>>sandwiches;
cout<<"Enter no. of candies : ";
cin>>candies;
for(int i=1;i<=sandwiches||i<=candies;i++)
{
if(sandwiches%i==0 && candies%i==0)
{
employees=i;
}
}
cout<<"Maximum number of employees to get the same number of sandwiches and the same number of candies : "<<employees;
return 0;
}
Attachments:
Answered by
14
Answer:
10 is the answer
Explanation:
HCF of 510 and 650 is 10
Similar questions
Math,
2 months ago
Math,
2 months ago
Math,
2 months ago
CBSE BOARD XII,
4 months ago
Math,
4 months ago
India Languages,
9 months ago
Physics,
9 months ago
Math,
9 months ago