#include <stdio.h> #define ROWS 3 #define COLS 3 void matrixMultiply(int *mat1, int *mat2, int *result, int rows1, int cols1, int cols2) { int i, j, k; // Multiplying matrices for (i = 0; i < rows1; i++) { for (j = 0; j < cols2; j++) { *(result + i * cols2 + j) = 0; for (k = 0; k < cols1; k++) { *(result + i * cols2 + j) += *(mat1 + i * cols1 + k) * *(mat2 + k * cols2 + j); } } } } void displayMatrix(int *mat, int rows, int cols) { int i, j; // Displaying matrix for (i = 0; i < rows; i++) { for (j = 0; j < cols; j++) { printf("%d\t", *(mat + i * cols + j)); } printf("\n"); } } int main() { int mat1[ROWS][COLS] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; int mat2[ROWS][COLS] = {{9, 8, 7}, {6, 5, 4}, {
How to make Dynamic Slider in php <div class="slider-area"> <div id="slider"> <?php $sqlidata1="SELECT * FROM `add_slider` WHERE `is_active` ='1'"; $countquery1=mysqli_query($conn,$sqlidata1); $count=0; while($datafact1=mysqli_fetch_array($countquery1)){ $sliderimage1= $datafact1['slider_image']; $count=$count+1; ?> <img src="admin/sliderimage/<?php echo $sliderimage1;?>" alt="slider-img" title="#caption<?php echo $count; ?>" /> <?php } ?> </div> <?php $sqlislider="SELECT * FROM `add_slider` WHERE `is_active` ='1'"; $countslider=mysqli_query($conn,$sqlislider); $slidercount=0; while($dataslider=mysqli_fetch_array($countslider)){ $slider_title=$dataslider['slider_title']; $sl