Write a C program to pass an array containing age of person to a function
C Program

Write a C program to pass an array containing age of person to a function

#include <stdio.h>float average(float a[]); // Function prototypeint main() {float avg, c[] = {23.4, 55, 22.6, 3, 40.5, 18}; // Array of agesavg = average(c); // Pass the array to the
  • October 30, 2024
c program
C Program

C Program for multiplication of two matrices

#include <stdio.h>#define MAX 10 // Maximum size of the matricesvoid multiplyMatrices(int first[MAX][MAX], int second[MAX][MAX], int result[MAX][MAX], int rowFirst, int columnFirst, int rowSecond, int columnSecond);int main() {int first[MAX][MAX], second[MAX][MAX], result[MAX][MAX];int rowFirst,
  • October 30, 2024
C Program

Write a C program to find sum of two matrices

#include <stdio.h>void main() {float a[2][2], b[2][2], c[2][2]; // Declare three 2x2 matricesint i, j;printf("Enter the elements of the 1st matrix:n");// Reading the first matrixfor(i = 0; i < 2; i++)for(j
  • October 30, 2024
c program
C Program

C program to accept N numbers and arrange them in an ascending order

#include <stdio.h>// Function to perform bubble sortvoid bubbleSort(int arr[], int n) {for (int i = 0; i < n - 1; i++) {for (int j = 0; j < n
  • November 4, 2024
c program
C Program

C Program to Increment every Element of the Array by one & Print Incremented Array

#include <stdio.h> // Include the standard I/O header file for using printf and other I/O functionsvoid main() {int i; // Declare an integer variable 'i' for loop indexingint array[4] =
  • November 5, 2024