fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int a[25],i,element;
  7. cout<<"Enter 5 Array Elements: ";
  8. for(i=0; i<5; i++)
  9. cin>>a[i];
  10. cout<<"\nEnter Element to Insert: ";
  11. cin>>element;
  12. a[i] = element;
  13. cout<<"\nThe New Array is:\n";
  14. for(i=0; i<6; i++)
  15. cout<<a[i]<<endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 5380KB
stdin
45
stdout
Enter 5 Array Elements: 
Enter Element to Insert: 
The New Array is:
45
5432
780248568
5432
72703
5432