.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

SUM OF THE TWO DIAGNOL OF A MATRIX

Posted By:Nikhil Kumar       Posted Date: February 28, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

SUM OF THE TWO DIAGNOL OF A MATRIX in c programming...
 

 

////SUM OF THE TWO DIAGNOL OF A MATRIX////
 
#include
#include
#include
#include
void main()
{
int i,j,k,s1=0,s2=0;
int a[3];
for(i=0;i<3,i++)
               for(j=0;j<3;j++)
               cin>>a[i][j];
cin>>a[i];
for(i=0;i<3;i++)
{              for(j=0;j<3;j++)
               {
               cout<0;i++,j--)
s2+=a[i][j];
cout<<"SUM OF FIRST DIAGONAL IS:"<

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend