Skip to main content

Posts

Showing posts with the label ignou result

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));         }         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},                             {

What is Compiler in C

What is Compiler Compile is a converting programming language into machine language.we are written a simple English language and computers do not understand the English language.  The  source file  written in the code human-readable ASCII text file (Source File).  The computer read 0 and 1 format. The compiler  human-readable code or text file, image file, and any file convert into machine language after the processing computer in this language. it got to have complied in machine language because computer read-only binary number format is 01010101. The compiler converts the   ASCII text file (Source File)  human-readable  into machine language. Compiler may be a software which converted program file into binary format in a single step. In simple words, the compiler may be a software which may take input from other language and converted into Low-Level Language (Machine Language) machine dependent language. Process of Translation You have written the program subsequent step is to save l

Contact Form

Name

Email *

Message *