AI is a technology that can do thing that humans are doing. So in future humans don’t have to these AI will do it for us.
Answer:
The following are code in the Java Programming Language.
//define boolean type function
boolean isReverse(int ar[], int b[])
{
//declare integer type variable
int x;
//set the for loop
for (x=0; x < ar.length && ar[x] == b[ar.length-1-x]; x++);
return x == ar.length;
}
Explanation:
<u>The following are the description of the code</u>.
In the above code that is written in the Java Programming Language, we define the boolean data type function that is 'is Reverse()' and pass two array integer data type arguments that is 'ar', 'b' in the then, declare integer data type variable that is 'x'. Set the for loop that the boolean type value is true or false.
Answer:
#HERE IS CODE IN PYTHON
#function to find length of shortest and longest string in the array
def fun(list2):
#find length of shortest string
mn=len(min(list2))
#find length of longest string
mx=len(max(list2))
#return both the value
return mn,mx
#array of strings
list2 = ['Ford', 'Volvo', 'BMW', 'MARUTI','TATA']
# call the function
mn,mx=fun(list2)
#print the result
print("shortest length is:",mn)
print("longest length is:",mx)
Explanation:
Create an array of strings.Call the function fun() with array as parameter. Here min() function will find the minimum string among all the strings of array and then len() function will find its length and assign to "mn". Similarly max() will find the largest string and then len() will find its length and assign to "mx". Function fun() will return "mn" & "mx".Then print the length of shortest and longest string.
Output:
shortest length is: 3
longest length is: 5
Technology has become such a major part of everyday life
because a business wants you to buy their product. Its like gas prices, when one gas price is lower than another stores, people tend to go to the one with the lower price.