Skip to main content

Search This Blog

matrix multiplication in c using functions and pointers

 #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)); ...

How to make Dynamic Slider in php

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'];
               $slider_description=$dataslider['slider_description'];
               $slider_button_link=$dataslider['slider_button_link'];
               $slider_image=$dataslider['slider_image'];
              $slidercount=$slidercount+1;
      ?>
   <div class="nivo-html-caption" id="caption<?php echo $slidercount;?>" >
      <div class="container">
         <div class="row">
            <div class="col-lg-12">
               <div class="slider-text wow fadeInDownBig" data-wow-delay=".5s" >
                  <h1>Now Shipping!</h1>
                  <h2><?php  echo $slider_title; ?></h2>
                  <p><?php echo $slider_description; ?><br /><span>Order now</span> & be ready too.</p>
                  <a href="<?php echo $slider_button_link;?>"><i class="fa fa-shopping-cart"></i>buy now</a>
               </div>
            </div>
         </div>
      </div>
   </div>
   <?php } ?>
</div>
<!-- slider-area-end -->

  • How to make Dynamic Slider in php ?

  • firstly open php tag <?php ?>, write a code in side of php tag.
  • and put this code and change your variable name.
  • it working code

Comments

Popular posts from this blog

Write a C program (use a switch statement for selection) to add or subtract 2 matrices having order 3 x 3, depending upon the choice made by the user

Write a C program (use a switch statement for selection) to add or subtract 2 matrices having order 3 x 3, depending upon the choice made by the user. MCS-011 : PROBLEM SOLVING AND   PROGRAMMING (June, 2017) c program for matrix operations using switch case, c program for addition and subtraction of two matrices, algorithm for matrix addition in c program #include <stdio.h> #include<conio.h> void main() {     int first_matrix[3][3], second_matrix[3][3], sub_of_two_matrix[3][3],sum_of_two_matrix[3][3], i, j;      int oprater;      clrscr(); //Enter First Matrix      printf("\nEnter elements of 1st matrix:\n");     for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) {     printf("Enter element a%d%d: ", i + 1, j + 1);     scanf("%d", &first_matrix[i][j]); } //Enter Second Matrix      printf("Enter elements of 2nd matrix:\n");     for (i = 0;...

how to multiple number enter and sort the Ascending Order

how to multiple number enter and sort the Ascending Order #include<Stdio.h> #include<conio.h> int main(void){ int a[10],b,c,n,i,j; printf("Enter number of elements :"); scanf("%d",&n); for(i=1; i<=n; i++){ printf("Enter any number :"); scanf("%d",&a[i]); } for(i=1; i<=n; i++){ for(j=i+1; j<=n; j++){ if(a[i]>a[j]){ b=a[i]; a[i]=a[j]; a[j]=b; } } } printf("Ascending Order :\n"); for(i=1; i<=n; i++){ printf("%d\t",a[i]); } getch(); }

Contact Form

Name

Email *

Message *