#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)); ...
Write and explain the following types of functions with the help of an example program for each (i) Function with no arguments and no return value. (ii) Function with arguments and no return value
hello Write and explain the following types of functions with the help of an example program for each (i) Function with no arguments and no return value. (ii) Function with arguments and no return value. ANS- 1: Function with no arguments and no return value: OUTPUT In this type the function has no arguments, it doesn't receive any data from the calling function. Similarly it doesn't return any value, the calling function doesn't receive any data from called function. So there's no digital communication between calling function and called function. #include<stdio.h> #include<conio.h> void sum(); void main() { clrscr(); sum(); getch(); } void sum() { int a,b; printf(”Enter any two numbers:”); scanf("%d%d",&a,&b); printf(”sum= %d”,a+b); } In this function no return and no argumen...
Ignou result tottaly destroyed the futureπππππ
ReplyDeletehmmmm
DeleteIS THERE NO SOLN OF LAB FOR BCSL 13 , 21 , 22 , 32 , 33 , 34 , 43 , 44 , 45 , MCSL016 FROM 2014 TILL JUNE 2018
Delete