sign up I login
 advanced
refer a friend - earn nickels!!

Ask & Discuss Questions with Community & Experts

Moderation Team
Ask iit jee aieee pet cbse icse state board community Discussion Response Post to: C++......
Forum Index -> Games, Puzzles and Quizzes -> View Full Question like the article? email it to a friend.  
Author Message
antonyajay21 (497)

Blazing goIITian

Olaaa!! Perrrfect answer. 91  [112 rates]

antonyajay21's Avatar

total posts: 319    
offline Offline
    /*Program to print the sum of upper triangle and
               lower triangle in a matrix*/
#include<iostream.h>
#include<conio.h>
void main()
{
int a[3][3],rows,columns,b[3][3],k,l;
clrscr();
for(int i=0;i<3;i++)
{
    cout<<" ";
    for(int j=0;j<3;j++)
    {
    cout<<"Enter the "<<i+1<<" "<<j+1<<" element";
    cin>>a[i][j];
    }
}
for(k=0;k<3;k++)
{
    for(l=0;l<3;l++)
    {
    b[k][l]=0;
    if(k==l)
    {
        b[k][l]+=a[k][l];
        cout<<b[k][l];
    }
    }
}
getch();
}

Be not afraid of growing slowly.
Be afraid only of standing still.

 this reply: 5 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
 

Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Narayana - Kota , Delhi , Others
Brilliant Tutorials - Class , Crash
Aakash Institute - Medical , Engg
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya