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 the problem with multiple inheritance?

1114


What is static modifier?

1153


What are the benefits of oop?

1190


Advantage and disadvantage of routing in telecom sector

1264


What is object-oriented programming? Webopedia definition

1206


Whats is abstraction in oops?

1036


What do you mean by overloading?

1040


What is an example of genetic polymorphism?

1134


Why is there no multiple inheritance?

966


What is overriding in oops?

1073


What does it mean when someone says I oop?

1024


Which language is not a true object oriented programming language?

1087


What is the main purpose of inheritance law?

1158


Why do we need oop?

1127


What is purpose of inheritance?

1068