answersLogoWhite

0


Best Answer

int mul (int a, int b)

{

int sum= 0;

for (; b>0; --b) sum -= -a;

for (; b<0; ++b) sum -= a;

return sum;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program that multiplies two numbers by repeated subtraction?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

If Trojan multiplies what kind of destroying action do they do?

If a Trojan computer virus multiplies is can change into a program that is made specifically&Ecirc;to destroy a computer. Some Trojan computer viruses are made to infect multiple computers.


Examples of logical errors in c program?

Logical errors :- These errors occur because of logically incorrect instructions in the program. Let us assume that in a 1000 line program, if there should be an instruction, which multiplies two numbers and is wrongly written to perform addition. This logically incorrect instruction may produce wrong results. Detecting such errors are difficult.


Program to display multiplication of two matrix?

The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.


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


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


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


How are Florida id numbers assigned?

Through a computer program that randomizes numbers.


What is Excel on computers?

Excel is a specialized program that manages numbers in various ways. It uses spreadsheets and data to process a large amount of numbers. One enters the data, or numbers, and the program calculates the numbrs in the manner you designate in the program.


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


How do you write a program in objective c numbers 1-100 prime numbers?

fdsgfhgdfhgdf