#include<iostream>
using namespace std;
void insert(int a[],int n)
{
cout<<"\nEnter the numbers=";
for(int i=0;i<n;i++)
cin>>a[i];
}
void show(int a[],int n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<" ";
cout<<"\n";
}
main()
{
int a[100],n;
cout<<"\nEnter number of terms=";
cin>>n;
if(n>100)
{
cout<<"\nInvalid";
return;
}
insert(a,n);
cout<<"\nThe array is=";
show(a,n);
}
using namespace std;
void insert(int a[],int n)
{
cout<<"\nEnter the numbers=";
for(int i=0;i<n;i++)
cin>>a[i];
}
void show(int a[],int n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<" ";
cout<<"\n";
}
main()
{
int a[100],n;
cout<<"\nEnter number of terms=";
cin>>n;
if(n>100)
{
cout<<"\nInvalid";
return;
}
insert(a,n);
cout<<"\nThe array is=";
show(a,n);
}
No comments:
Post a Comment