Course Solutions Uncategorized (Solved) : Include Using Namespace Std Int Main Int Num 10 1 2 3 4 5 6 7 8 9 10 Int 0 10 Num Num 1 Co Q28595214 . . . .

(Solved) : Include Using Namespace Std Int Main Int Num 10 1 2 3 4 5 6 7 8 9 10 Int 0 10 Num Num 1 Co Q28595214 . . . .

 

#include<iostream>
using namespace std;

int main()
{
   int num[10] = { 1,2,3,4,5,6,7,8,9,10 };

   for (int i = 0; i < 10; i++)
   {
       if (num[i] > num[i + 1])
           cout <<“Array elements ” << i << ” and ” << i + 1<< ” are out of ordern”;
   }

   return 0;
}

I want to check whether my code is in ascending order, but italways show “Array element 9 and 10 are out of order” which isincorrect.

What is the error in my code and how to fix it?

Expert Answer


An answer will be send to you shortly. . . .

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Who Can Answer These In 5 Minutes(Answered) : Who Can Answer These In 5 Minutes

<h3>Question Description</h3> <h3>QUESTION 9</h3><ol><li>An increase in the inventory holding costs would ________________ the economic order quantities.<table><tbody><tr> <td/><td>not affect</td></tr><tr> <td/><td>increase</td></tr><tr> <td/><td>decrease</td></tr><tr> <td/><td>would cancel </td></tr></tbody></table></li></ol><p>10 points </p><h3>QUESTION 10</h3><ol><li>Assume that your company follows