write a c++ code of diagonal matrix.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / md.ekramul kabir
#include<stdio.h>
void main(void)
{
int row=0,column=0;
int data[4][4];
for(row=0;row<=3;row++)
{
for(column=0;column<=3;column++)
{
scanf("%d",&data[row][column]);
}
}
printf("\nYour Matrix is : \n");
for(row=0;row<=3;row++)
{
for(column=0;column<=3;column++)
{
printf("%d\t",data[row][column]);
}
printf("\n");
}
}
| Is This Answer Correct ? | 13 Yes | 30 No |
what is the difference between containership and inheritence?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
what is object slicing?
What is function overloading?,describe it with the example.
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.
Program to read a comment string
DIFFRENCE BETWEEN STRUCTURED PROGRAMING AND OBJCET ORIENTED PROGRAMING.
Can we have inheritance without polymorphism?
polymorphism means?
Which is better struts or spring?
What is and I oop mean?
What is encapsulation and abstraction? How are they implemented in C++?
0 Answers Agilent, ZS Associates,