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 |
Contrast OOP and SOA. What are tenets of each?
1 Answers Siebel Systems, Wipro,
What are the access specifiers avaible in c++?
Whatis the difference between oop and object based language
any one please tell me the purpose of operator overloading
WHAT'S THE OOPS BASIC OOPS CONCEPTS IN DOTNET
What is a class?
32 Answers Infosys, TCS, Thylak,
What is virtual class and friend class?
what is the use of mutable key word
Write a program to multiply 3x3 matrics
What normal C constructs work differently in C++?
create a c++ program that will ask 10 numbers and display their sum using array.
Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku