Problem1:
Hints:
Source Code
Problem1:
Problem2:
·
An ice
cream truck visits Mr. Akhtar's neighborhood every 4 days during the summer.
Unfortunately, he missed it today. When can Mr. Akhtar expect the ice cream
truck to visit her neighborhood again? Print at least 5 possible values.
Problem2:

Hints:
To find the Least Common Multiple of
two or more whole numbers, follow this procedure:
 Make a list of multiples for each whole number.
 Continue your list until at least two multiples are common to all lists.
 Identify the common multiples.
The
Least Common Multiple (LCM) is the smallest of these common multiples
Find the LCM of 12 and 15.




Common multiples of 12 and 15 are
60 and 120


The least common multiple
of 12 and 15 is 60.


Solution:

LCM = 60

Source Code
Problem1:
Problem2:
/* problem 2 */
ReplyDelete#include
#include
int main()
{
int a,b,truck1=4,truck2=5,t,gcd,lcm;
a=truck1;
b=truck2;
printf("posibility of vist same day is:");
while(b!=0)
{
t=b;
b=a%b;
a=t;
}
gcd=a;
lcm=(truck1*truck2)/gcd;
printf("%d",lcm);
return 0;
}
Id:201820505
ReplyDeleteBatch:58th
#include
#include
int main()
{
int a,b,truck1=4,truck2=5,t,gcd,lcm;
a=truck1;
b=truck2;
printf("posibility of vist same day is:");
while(b!=0)
{
t=b;
b=a%b;
a=t;
}
gcd=a;
lcm=(truck1*truck2)/gcd;
printf("%d",lcm);
return 0;
}