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 are the ways in which a constructors can be called?
what is a virtual class?
5 Answers Cap Gemini, IBM, Infosys, Trinity Technologies,
What is polymorphism explain its types?
Should you protect the global data in threads? Why or why not?
What is a class and object?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What makes a language oop?
4. What do you mean by a prototype? Define analysis prototype
is there any choice in opting subjects like 4 out of 7
what are the realtime excercises in C++?
what is the size of an empty class
what is the difference between ERROR and EXCEPTION?