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

add 2 numbers in c

#include<stdio.h>
int main() {
int a, b, sum;
printf("
Enter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
Comment

c program to add two numbers

Enter two integers: 12
11
12 + 11 = 23
Comment

addition in c

/*Program for adding two numbers*/
#include <stdio.h>
int main(){
	int a, b, sum; //declare the variables that will be used, a will store the first number, b second number and sum, the sum.
    printf("Enter the first number: 
"); //Prompts user to enter the first number.
    scanf("%d", &a);//Accepts input and saves it to variable a
    printf("Enter the second number: 
");
    scanf("%d", &b);
    sum = a + b; //Formular to add the two numbers.
    printf("Sum is %d", sum);
}
Comment

c code to add two numbers

int n,m;
printf("%d",n+m);
Comment

addition of two numbers in c

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

add 2 numbers in c

#include <stdio.h>

int addNumbers(int a, int b)
{
    int sum = a + b;
    return sum;
}

int main(void)
{
    int a = 4;
    int b = 7;

    printf(addNumbers(a,b));
    return 0;
}
Comment

C program to addition of two numbers

#include <stdio.h>int main(){ int a, b, sum;printf("Enter two integers");scanf("%d %d", &a, &b);sum = a + b; printf("%d + %d = %d", a, b, sum);return 0;}
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 :: hello word in c 
C :: warning: function returns address of local variable [-Wreturn-local-addr] 
C :: The fscanf and fprintf functions 
C :: prime factorization of factorials using c 
C :: print variable adress c 
C :: functions in c 
C :: c round float 
C :: memory layout in c 
C :: c language string 
C :: c check if character is an alphabet 
C :: adjacency matrix representation maker 
C :: Palindrome number in c program 
C :: array of strings in c 
C :: c median of array 
C :: convert char number to int in c 
C :: C program to input the month number and output the month name using switch statement 
C :: adding a node in the front on a linked list 
C :: fread 
C :: rust set toolchain 
C :: integer in c 
C :: windows make clean 
C :: how to declare a struct in c 
C :: linux_reboot_magic2 
C :: how to check file pointers in c 
C :: left me on read 
C :: grep C hello world 
C :: abs() for floting point in C 
C :: deepak 
C :: visa germany algeria 
C :: c byte vs char 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =