Triangular Number Pattern in C

#include<stdio.h> #include<stdlib.h> int main(){ int i,j,k,l,n; system("cls"); printf("enter the range="); scanf("%d",&n); for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { printf(" "); } for(k=1;k<=i;k++) { printf("%d",k); } for(l=i-1;l>=1;l--) { printf("%d",l); } printf("\n"); } return 0; }

Matrix Multiplication in C

#include <stdio.h> int main() { int m, n, p, q, c, d, k, sum = 0; int first[10][10], second[10][10], multiply[10][10]; printf("Enter number of rows and columns of matrix 1 \n"); scanf("%d%d", &m, &n); printf("Enter elements of first matrix\n"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d",... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started