Answer:
There is only one modification in the above loop i.e. while loop should be like this--
while (i != n)
{
sum+=arr[i]; // Line 1, In question segment it is line 2.
i++; // Line 2, In question segment it is line 1.
}
Output:
Now if the array input is 1,2,3,4,5 then the output is 15.
Explanation:
In the above question, all the line of the segment is right except the body of the loop because--
- The First line of the loop is increment statement which increments the value of "i" variable from 1 and the value of "i" variable will be 1 in the first iteration of the loop
- The second line starts to add the value from 1'st index position of the array. Hence the segment gives the wrong answer. It adds the arr[1] to arr[n-1].
- So I interchanged both lines of the while loop as shown in the answer part. I make the line 1 (In question segment) as line 2(In answer part) and line 2 (In question segment) as line 1 (In answer part).
Now It gives the correct output because it can add arr[0] to arr[n-1].
Answer:
The real world AI application is Google Duplex. It is able to receive orders for making reservations. Then it calls the shop or the place and deals with the person and talks to him very fluently and informs you about the reservation. Some other general types of AI application are Google Assistant, Siri , Amazon Alexa and so on. But google Duplex is lot more advanced than them.
Ask your self questions can help you think of what to measure, in order to get answers.
Profile? Perhaps... If you go on social media sites like Facebook it's typically on your profile, right?
The program is
num = int(input("Enter Numerator "))
den = int(input("Enter Denominator "))
print("quotient is ",str(num//den)," remainder is ", str(num%den))
<h3>
How to create a division sign in HTML?</h3>
To create a division sign ( ÷ ) in HTML you can use any of the following codes.
÷
÷
÷
<h3>
How to divide in computer programming?</h3>
Perl code
use strict;
my $first = 15;
my $second = 5;
my $answer = $first / $second;
print "You get $answer if you divide $first by $second";
When the script above is run, it displays "You get 3 if you divide 15 by 5" on the screen.
To learn more about programming, refer
https://brainly.ph/question/4743
#SPJ4