Search
 
SCRIPT & CODE EXAMPLE
 

C

addition of two matrix in c

#include<stdio.h>
void main(){
    int r,c,i,j,a[100][100],b[100][100],sum[100][100];
    printf("Enter number of rows : ");
    scanf("%d",&r);
    printf("Enter number of columns : ");
    scanf("%d",&c);
    
    printf("##### First Matrix ###### 
");
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            printf("Enter element a %d%d : ",i+1,j+1);
            scanf("%d",&a[i][j]);
        }
    }
    printf("##### Second Matrix ###### 
");
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            printf("Enter element a %d%d : ",i+1,j+1);
            scanf("%d",&b[i][j]);
        }
    }
    //additon of two matrix
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            sum[i][j] = a[i][j] + b[i][j];
        }
    }
    //to show the resultant matrix
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            printf("%d	",sum[i][j]);
        
        if(j == c-1){
            printf("
");
        }
        }
    }
    
}
Comment

addition of two numbers in c

int num1,num2;
printf("%d",num1+num2);
Comment

addition of two numbers in c

//addition of two numbers
int number1,number2;
puts("Enter two numbers");
scanf("%d%d",&number1,&number2);
printf("addition is :%d",number1+number2)
Comment

addition of two numbers in c

//test
Comment

PREVIOUS NEXT
Code Example
C :: Prime Number Check Program in C 
C :: populate a map c++ 
C :: fonction recursive successeur nombre chaine de caractere en c 
C :: printf signed char 
C :: operators priority in c 
C :: fast inverse square root explained 
C :: print 0 1 2 3 4 in c 
C :: silicon valley 
C :: find smallest number in array in c 
C :: c fractional sleep 
C :: matplotlib plot circle marker 
C :: puts without newline c 
C :: C read a character 
C :: fopen function in c 
C :: c program to find the factorial of a number 
C :: slug urls django 
C :: add a item to cart woocomerce with quantity 
C :: c programming how to force stop the programme 
C :: enum in c 
C :: Example of Implementation of a pointer to an array in C: 
C :: server client tcp in C 
C :: memcpy in c 
C :: malloc 
C :: function array median 
C :: best approach c menu terminal 
C :: mediawiki upload size 
C :: Write a C program to multiply two integers using pointers. 
C :: c malloc array 
C :: C program to calculate the sum of odd and even numbers 
C :: How to send an array through a pipe 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =