Skip to content

Instantly share code, notes, and snippets.

@Lulzx
Created April 28, 2019 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lulzx/912a80edaffc4e13f23804c7eb4773f9 to your computer and use it in GitHub Desktop.
Save Lulzx/912a80edaffc4e13f23804c7eb4773f9 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void check(int matrix, int rows, int columns){
printf("%d", matrix[0][0]);
}
int main(){
int rows, columns, n, matrix[1000][1000];
scanf("%d%d", &rows, &columns);
for(int i = 0; i < rows; i++){
for(int j = 0; j < columns; j++){
scanf("%d", &matrix[i][j]);
}
}
check(&matrix[rows][columns], rows, columns);
}
@Lulzx
Copy link
Author

Lulzx commented Apr 28, 2019

#include<stdio.h>
void poin_mat(int *mat , int rows ,int columns );
int main()
{
int i , j , mat[1000][1000] , rows , columns ;
scanf("%d%d",&rows,&columns);
if(rows!=columns)
{
printf("Enter equal number of rows and columns");
}
else
{
for(i=0;i<rows;i++)
{
for(j=0;j<columns;j++)
scanf("%d",&mat[i][j]);
}

	poin_mat(&mat,rows,columns);

}

}
void poin_mat(int *mat[][] , int rows , int columns)
{
int i , j , flag ;

	flag = 1;
	for(i=0;i<rows;i++)
	{
		printf("\n");
		for(j=0;j<columns;j++)
		{
			printf("%d", mat[i][j]);
			if(i>j && mat[i][j]=0)
			{
				flag=0;
			}
		}
	}
	if(flag==1)
	{
		printf("\nThe matrix is upper triangular matrix ");

		for(i=0;i<rows;i++)
		{
			printf("\n");
			for(j=0;j<columns;j++)
			{
				printf("%d",mat[i][j]);
			}
		}
	}
	else
	{
		printf("\nThe matrix is not upper triangular matrix\n");
	}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment