C++ PROGRAM-GIVE COMMENTS (HOW THE CODE SOLVED i.e logics) ON EACH LINE OF THE CODE BELOW. ACTUAL QUESTION: Write a program to insert an element at 17th index in an array of 20 elements. Take all...


C++ PROGRAM-GIVE COMMENTS (HOW THE CODE SOLVED i.e logics) ON EACH LINE OF THE CODE BELOW.


ACTUAL QUESTION: Write a program to insert an element at 17th index in an array of 20
elements. Take all elements from user and display the output.


NOTE: IF YOU CAN'T ADD COMMENTS ON THIS CODE THEN DO ANOTHER CODE AND ADD COMMENTS ON THAT PLEASE. THANKS


CODE:


#include
using namespace std;




int main()
{
cout<>
int arr[20],num;
cout<"enter 20="" numbers:="">
for (int i = 0; i < 20;="">
{
cin>>arr[i];
}


cout<"enter 17th="" element:="">
cin >> num;
cout<"\narray before="" changing="" 17th="" element:="">
for (int i = 0; i < 20;="">
{
cout < arr[i]="">< "="">
}


arr[16] = num;
cout < "\narray="" after="" changing="" 17th="" element:="">
for(int i=0;i<>
{
cout<><">
}
cout <>


return 0;
}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here