C++ Program Here is some problem that i faced.After compile it opened a popup window and give me error message "textc.exe has stopped" then i got black screen.
#include<iostream>
using namespace std;
int main()
{
int i,n,a[10],b[10]//a[10],b[10];
cout<<"enput array size: ";
List item
cin>>n; cout<<"Enter some number"; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<n;i++) { b[i]=a[i]; cout<<"a["<<i<<"]= "<<a[i]<<"\t\t"<<"b["<<i<<"]="<<b[i]<<"\n"; } return 0; }
If i change my code little bit as like a[10],b[10] instead of a[n],a[n]
then it work perfectly. what is wrong here.