competitive-programming-solutions icon indicating copy to clipboard operation
competitive-programming-solutions copied to clipboard

Find last element of array

Open 9982108331 opened this issue 5 years ago • 2 comments

#include<bits/stdc++.h> using namespace std; int main() { cout<<"Enter number of elements in array"; int n; cin>>n; int array[n]; cout<<"Enter elements in array"; for(int i=0;i<n;i++){ cin>>array[i]; } cout<<array[n-1]; }

9982108331 avatar May 19 '20 05:05 9982108331

Hello @9982108331 This code is working fine but you need to add "cout<<endl;" after line no 5 , 9 and 12. So that it looks proper on the console. If you need help, I am willing to work on this issue if you want.

Avinash9k5r avatar Aug 23 '20 12:08 Avinash9k5r

Hi @9982108331. Can I work on this.....

Sajal193 avatar Jun 20 '21 20:06 Sajal193