answersLogoWhite

0

1.Declare three variables as
int a,b,c;


2.Get the Input of two numbers of Integers from the user:
scanf("%d",&a);
scanf("%d",&b);

3.add a and b and store the result in c

4. print c

User Avatar

Wiki User

∙ 17y ago
User Avatar

What else can I help you with?

Continue Learning about Engineering

A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


What is are advatages and disadvatages of bresenham's line algorithm?

1. High accuracy. Comparing to Basic Incremental algorithm (especially if the slope were > 1.) 2. High speed. Comparing to Digital Differenmtial algorithm. 3. Draws the line between any two points. Comparing to Basic Incremental algorithm which can't draw if x0 > x1 ( the format is: (x0, y0), (x1, y1). )


Write flowchart searching algorithm?

flow chart to swap two number


What are the differences between Bresenham's line algorithm and Bresenham's circle algorithm?

DDA uses float numbers and uses operators such as division and multiplication in its calculation. Bresenhams algorithm uses ints and only uses addition and subtraction. Due to the use of only addition subtraction and bit shifting (multiplication and division use more resources and processor power) bresenhams algorithm is faster than DDA in producing the line. Im not sure, though if i remember right, they still produce the same line in the end. One note concerning efficiency: Fixed point DDA algorithms are generally superior to Bresenhams algorithm on modern computers. The reason is that Bresenhams algorithm uses a conditional branch in the loop, and this results in frequent branch mispredictions in the CPU. Fixed point DDA also has fewer instructions in the loop body (one bit shift, one increment and one addition to be exact. In addition to the loop instructions and the actual plotting). As CPU pipelines become deeper, mispredictions penalties will become more Severe.


How do you write a algorithm that gives the GCD of two given numbers?

algorithm GCD (a, b) is:while (a b) doif a > b then a := a - b else b := b - aend whilereturn a

Related Questions

A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


What is integer addition in computer science?

Integer addition is simple adding two non-decimal numbers together. For example 2+2 is integer addition.


Write an algorithm for multiplication of two sparse matrices?

how to multiply two sparse matrices


Explain How do you determine the difference when subtracting two integers with different signs?

Examples: Write the first integer as it is, turn the subtraction into the addition, change the sign of the second integer, and follow the rules of addition. -7 - (2) = -7 + (-2) = -(7 + 2) = -9 10 - (-8) = 10 + (+8) = 18


What is are advatages and disadvatages of bresenham's line algorithm?

1. High accuracy. Comparing to Basic Incremental algorithm (especially if the slope were > 1.) 2. High speed. Comparing to Digital Differenmtial algorithm. 3. Draws the line between any two points. Comparing to Basic Incremental algorithm which can't draw if x0 > x1 ( the format is: (x0, y0), (x1, y1). )


Is the set of negative integers is closed under addition?

No, the set of negative integers is not closed under addition. When you add two negative integers, the result is always a negative integer. However, if you add a negative integer and a positive integer, the result can be a positive integer, which is not in the set of negative integers. Thus, the set does not satisfy the closure property for addition.


Write flowchart searching algorithm?

flow chart to swap two number


What does it mean if an integer is closed?

You don't say that "an integer is closed". It is the SET of integers which is closed UNDER A SPECIFIC OPERATION. For example, the SET of integers is closed under the operations of addition and multiplication. That means that an addition of two members of the set (two integers in this case) will again give you a member of the set (an integer in this case).


What are the differences between Bresenham's line algorithm and Bresenham's circle algorithm?

DDA uses float numbers and uses operators such as division and multiplication in its calculation. Bresenhams algorithm uses ints and only uses addition and subtraction. Due to the use of only addition subtraction and bit shifting (multiplication and division use more resources and processor power) bresenhams algorithm is faster than DDA in producing the line. Im not sure, though if i remember right, they still produce the same line in the end. One note concerning efficiency: Fixed point DDA algorithms are generally superior to Bresenhams algorithm on modern computers. The reason is that Bresenhams algorithm uses a conditional branch in the loop, and this results in frequent branch mispredictions in the CPU. Fixed point DDA also has fewer instructions in the loop body (one bit shift, one increment and one addition to be exact. In addition to the loop instructions and the actual plotting). As CPU pipelines become deeper, mispredictions penalties will become more Severe.


Write an addicion story for two 3-digit number?

write an addition story for two 3-digit numbers. write the answer to your story


How do you add integers with different signs?

1. Take the absolute values of those two integers.2. Find the difference.3. Determine which integer is the largest. If that integer is positive, then the answer is positive. If that integer is negative, then the answer is negative.


Are all integers closed under addition?

Yes, all integers are closed under addition. This means that when you add any two integers together, the result is always another integer. For example, adding -3 and 5 yields 2, which is also an integer. Therefore, the set of integers is closed under the operation of addition.