write a program to enter 10 numbers in an array and then print all the nos from last element to first element
Answers
Answered by
0
#include<iostream.h>
#include<conio.h>
void main()
{
int a[40],n;
cout<<"Enter size:";
cin>>n;
cout<<"enter the numbers:";
for(int i=0;i<n;i++)
cin>>a[i];
cout<<"array of elements from last to first:";
for(i=n;i>=0;i--)
cout<<a[i];
getch();
}
#include<conio.h>
void main()
{
int a[40],n;
cout<<"Enter size:";
cin>>n;
cout<<"enter the numbers:";
for(int i=0;i<n;i++)
cin>>a[i];
cout<<"array of elements from last to first:";
for(i=n;i>=0;i--)
cout<<a[i];
getch();
}
Answered by
0
Write a program to enter 10 numbers in an array and then print all the nos from last element to first element
Attachments:
Similar questions