Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a c++ code of diagonal matrix.

Answer Posted / senthil.k,arasur

void main()
{
int a,b,c;
cout<<"Diagonal matrix";
for(a=1;a<=3;a++)
{
for(b=1;b<=3;b++)
{
c=1;
if(c==b)
{
cout<<c;
}
else
{
cout<<"0";
}
}
c++;
cout<<"\n";
}
}
output:

1 0 0
0 2 0
0 0 3

Is This Answer Correct ?    38 Yes 52 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction in oops?

1089


What is multilevel inheritance in oop?

1086


Are polymorphisms mutations?

1209


Get me a number puzzle game-program

2307


What is the highest level of cohesion?

1110


write string class as your own class in java without using any built-in function

2549


What are the 3 principles of oop?

1167


what is the drawback of classical methods in oops?

3428


What is encapsulation in simple terms?

1096


What is overloading in oop?

1045


Who invented oop?

1191


What is pointer in oop?

1119


Please send ford technologies placement paper 2 my mail id

2145


write a programe to calculate the simple intrest and compund intrest using by function overlading

2254


What is encapsulation process?

1100