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 type of loop is a for loop?

1091


How do you explain polymorphism?

1079


What does and I oop mean in text?

1229


How to hide the base class functionality in Inheritance?

1139


write a program to find 2 power of a 5digit number with out using big int and exponent ?

2383


What is polymorphism in oops with example?

1056


what type of question are asked in thoughtworks pair programming round ?

2218


What is variable example?

1037


to find out the minimum of two integer number of two different classes using friend function

2140


State what is encapsulation and friend function?

1267


What does it mean when someone says I oop?

1063


Which type does string inherit from?

1106


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1955


What do you mean by abstraction?

1072


What is this pointer in oop?

1074