write a c++ code of diagonal matrix.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the important components of cohesion?

734


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1686


What is the main feature of oop?

880


Why is encapsulation used?

751


What is for loop and its syntax?

786


Why is object oriented programming so hard?

806


What is use of overloading?

843


Can we override main method?

821


What is methods in oop?

740


Write a program to sort the number with different sorts in one program ??

2093


What is difference between inheritance and polymorphism?

761


What is polymorphism what is it for and how is it used?

752


What is a class oop?

752


What is the oops and benefits of oops programming?

725


Why is oop useful?

805