What are the values of n and m you are providing???
On Tue, Sep 20, 2011 at 7:02 PM, deependra <[email protected]>wrote:
> long int n,m;
> cin>>n>>m;
> long int a[n][m];
> a[0][0]=1;
> for(long int i=1;i<n;i++)
> a[i][0]=0;
> for(long int i=1;i<m;i++)
> a[0][i]=0;
> long int z=0;
> for(long int i=1;i<n;i++)
> {
> for( long int j=1;j<m;j++)
> {
> a[i][j]=(j*(a[i-1][j]) + a[i-1][j-1] );
> z=a[i][j];
> }
> }
> int mod= z%2;
> cout<<mod<<endl;
>
> m getting segmentation fault error at run time in the above code.
> can any one explain segmentation fault and how to remove it??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
@ |3 # ! /\/ @ \./
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.