Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 10 v1
#include <stdio.h> int main(void) { int A[10][10]={{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; int n0c=0,utxp=0,ltxp=0; int xs1=0,xs2=0; int ys1=0,ys2=0; for( xs1=0;xs1<10;xs1++){ for(ys1=0;ys1<10;ys1++){ scanf("%d",&A[xs1][ys1]); } } for(xs2=0;xs2<10;xs2++) for(ys2=0;ys2<10;ys2++){ if(A[xs2][ys2]!=0){ ++n0c; printf("n0c=%d\n",n0c); } if(xs2>ys2&&A[xs2][ys2]!=0){ utxp++; } if(xs2<ys2&&A[xs2][ys2]!=0){ ltxp++; } } if(utxp==0){ printf("The matrix is an upper triangular matrix\n"); } if(ltxp==0){ printf("The matrix is a lower triangular matrix\n"); } printf("Number of Non-Zero #=%d\n",n0c); }
run
|
edit
|
history
|
help
0
Assignment 2
romitk
Test2
array poi
WAP in C to print the reverse of a string
recursive fundamentos
hello
test
print name
Spring 2017 Project 2 v.03