answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

int a,b,c,n;

printf("enter the numbers");

scanf("%D",&n);

for(i=0;i<n;i++)

a=b;

a=c;

c=a+b;

printf("the sum is %c",);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int a[5][5],b[5][5],c[5][5],i,j,k;

cin>>enter the matrix a;

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

cout<<a[i][j];

}

}

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

cout<<b[i][j];

}

}

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

c[i][j]=a[i][j]+b[i][j];

cout<<c[i][j];

}

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int h,k;

printf("enter number");

scanf("%d",h);

printf("enter number");

scanf("%d",k);

printf("\nthe answer is %d",h+k);

getch();

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c program to read two numbers and perform addition and subtraction of two matrices?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is matrix programming in C programming?

C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion


Can you add a variable with a number?

Yes, IF the variable has been declared, has a value, and is of a numerical type such that your addition operator can perform the operation on the number and the value of that type variable. The compiler or interpreter will look up the variable's value, substitute it for the variable, and perform the addition just as if your statement used two numbers. First example: If your number is an integer and your variable is of type real, almost any addition operator can successfully add the two. Second example: If your number is a real and your variable is a character type (with a value, say, of "Smith"), the addition will obviously fail. In many languages, however, variables of type Boolean may be handled arithmetically, as the value True equals 1 and False is zero.


Advantages and disadvantages of logarithm?

Maps and navigational tools needed a huge number of calculations, including multiplications (or divisions) of numbers with several digits. In pre-computer days it was not easy to get people who could do this with a high degree of accuracy. Logarithms changed multiplication into addition and division into subtraction. These were operations that less skilled clerks were able to perform. This advantage has largely disappeared with the easy availability of calculators. The exponential function is one of the more important functions in advanced mathematics, physics and economics. The logarithm function is the inverse of the exponential function and so has very many applications.


Sample program of arithmetic operation in assembly language?

The simple Assembly Programs: mov ax,15 mov bx,45 add ax,bx int 21 This is a simple Assembley programs that perform addition of two numbers like 15,45 in above example


How do you perform Parallel Adder Addition?

A binary parallel adder is a digital function that produces arithmetic sum of two binary numbers in parallel. It consists of full-adder combinational arrangement thus, the output carry from one full adder connected to the input carry of next full- adder.

Related questions

Function of abacus?

An abacus is an ancient form of the modern day calculator.


What function did the step reckoner perform?

Operations such as addition and subtraction


How do you perform arithmetic operations on binary numbers?

There are a few rules to perform arithmetic operations in binary numbers. According to those rules you can add or subtract binary numbers. There are only two arithmetic operations used in binary numbers, they are addition and subtraction.


What is matrix programming in C programming?

C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion


In order to perform this opertation fractions must have the same denominators?

Addition or subtraction


What perform a possible math operation?

By using division, multiplication, addition or subtraction


What is an adding machine?

An adding machine is a mechanical or electromechanical calculator which could perform addition and subtraction.


Can we perform Addition of 1 to n numbers?

Yes.


What mathematical operations was the Stepped Reckoner supposed to perform?

The four basic operations of arithmetic: addition, subtraction, multiplication, division.


Should you perform operations in parentheses first?

Yes - the parts in brackets should be done first. Use BEDMAS as a guide. Brackets - Exponents (eg. x2) - Division - Multiplication - Addition - Subtraction. Although if it is just addition and subtraction you should work from left to right.


What are the primary arithmetic operations a computer program can perform?

The four primary arithmetic operations a computer program can perform are addition, subtraction, multiplication and division.2 + 3 = 5 is an example of addition9 - 7 = 7 is an example of subtraction2 x 3 = 6 is an example of multiplication10 / 2 = 5 is an example of division


What are facts about numbers?

Numbers are mathematical symbols used to represent quantities and perform calculations. They can be classified into various types including whole numbers, natural numbers, rational numbers, irrational numbers, and complex numbers. Numbers can be positive, negative, or zero, and they can be used in various mathematical operations such as addition, subtraction, multiplication, and division.