Computer Science, asked by gowthamraj8106, 4 months ago

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 dreamrob
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 programpython001
14

Answer:

10 is the answer

Explanation:

HCF of 510 and 650 is 10

Similar questions