Answer:
def cal(n):
s=0
while n>0:
r=n%10
if(r==0 or r==4 or r==6 or r==9):
s=s+1
elif r==8:
s=s+2
n=n//10
print(s)
n=int(input("enter number:"))
print(n)
cal(n)
Explanation:
- Create a function to calculate count of closed path
.
- Create a variable to store count of closed path
.
- While number is positive
, extract last digit of n
.
- Reduce number by truncating last digit
.
- Make a function call to compute count of path.
Answer:
Following is given the code as required.
I hope it will help you!
Explanation:
Answer:
for(String s:words)
if(s.endsWith("ing"))
System.out.println(s);
Explanation:
Create an enhanced for loop that iterates through the words array
Check if an element in words ends with "ing" using endsWith() method (Since it is said that strings are lowercase letters, we do not need to check it)
If you find one that ends with "ing", print the element
Spring break around Easter I would believe