Advertisement
adcorp

matrix 2

Dec 2nd, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. // sum to calc sum of first column
  2. #include<iostream.h>
  3. #include<conio.h>
  4. #include<stdio.h>
  5. void main()
  6. {
  7. clrscr();
  8. int a[3][3];
  9. int sum=0;
  10. cout<<"enter the nos: ";
  11.  for( int i=0;i<3;i++)
  12.    {
  13.       for(int j=0;j<3;j++)
  14.     {
  15.      cin>>a[i][j];
  16.  
  17.     }
  18.    }
  19.  for(int x=0;x<3;x++)
  20.  {
  21.      sum=a[x][0]+sum;
  22.    }
  23.  cout<<"sum is:"<<sum;
  24.  getch();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement