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
What is destructor example?
How can you overcome the diamond problem in inheritance?
• What are the desirable attributes for memory managment?
#include
Why do we use oops?
What is a class oop?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What is an example of genetic polymorphism?
What is debug class?what is trace class? What differences are between them? With examples.
What is class and object with example?
What do you mean by abstraction?
What is polymorphism and example?
Can private class be inherited?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).