answersLogoWhite

0

/*PROGRAM TO ACCEPT TWO NUMBERS FROM THE USER AND PRINT THEIR MULTIPLICATION. */

#include<stdio.h>

#include<conio.h>

void main()

{

int a, b, c; // Declaration of Variables. Variables 'a' & 'b' to hold first & second number. And 'c' to hold result.

clrscr(); // To clear the output screen every time program is executed.

printf("\n Enter the first number : ");

scanf("%d", &a); // To accept the first number.

printf("\n Enter the second number : ");

scanf("%d", &b); // To accept the second number.

c = a*b; // Logic to get the product of the entered two numbers.

printf("\n Multiplication of %d & %d = %d", a, b, c); // Displaying result.

getch(); // To hold the output screen.

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

How do you write a C program to find the GCD of two given integers using non recursive functions?

Use the following function: int gcd (int a, int b) { while (b != 0) { a %= b; a ^= b ^= a ^= b; } return a; } Note that a ^= b ^= a ^= b is an efficient method of swapping two values.


Write a program to find gcd using recursive method in java?

for two positive integers: public static int gcd(int i1, int i2) { // using Euclid's algorithm int a=i1, b=i2, temp; while (b!=0) { temp=b; b=a%temp; a=temp; } return a; }


What is the least common multiple of decimals and fractions in C?

To calculate the least common multiple (lcm) of decimals (integers) and fractions you first need to calculate the greatest common divisor (gcd) of two integers: int gcd (int a, int b) { int c; while (a != 0) { c = a; a = b % a; b = c; } return b; } With this function in place, we can calculate the lcm of two integers: int lcm (int a, int b) { return a / gcd (a, b) * b; } And with this function in place we can calculate the lcm of two fractions (a/b and c/d): int lcm_fraction (int a, int b, int c, int d) { return lcm (a, c) / gcd (b, d); }


Write a c program to find the product of two numbers without using operator?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a,b,multi; clrscr(); printf("enter a value for a and b"); scanf("%d%d",&amp;a,&amp;b); multi=a*b; printf("the result is %d", multi); getch() }


What are the conditions to swap in c plus plus without temporary?

You can swap two integers without temporary storage by bitwise exclusive-or'ing them in a specific sequence...a ^= b;b ^= a;a ^= b;

Related Questions

What is the distributive property of addition over multiplication for integers?

Addition is not distrbutive over multiplication. In general,a + (b*c) &Atilde;&cent;&acirc;&euro;&deg;&nbsp; (a+b)*(a+c) [unless a+b+c = 1]


When multiplying two integer what are the four possible combination of sign how can they be grouped into two integers?

The four possible combinations are:A = (+, +)B = (+, -)C = (-, +) andD = (-, -)In A and D, the two numbers have the same signs and the multiplication gives a positive answer.In B and C, the two numbers have different signs and the multiplication gives a negative answer.


How you write multiplication program without asterisk symbol?

a*b = exp (ln a + ln b)


What is b and a if both are positive integers but a does not equal b?

Then they are, simply, two different integers. Any two positive integers will do, according to the specification.Then they are, simply, two different integers. Any two positive integers will do, according to the specification.Then they are, simply, two different integers. Any two positive integers will do, according to the specification.Then they are, simply, two different integers. Any two positive integers will do, according to the specification.


What is the difference between 2 positive integers is 40?

The two integers are A and A+40 or, equivalently, B and B-40.


Are cubed numbers closed under multiplication?

Yes. If you have two positive integers "a" and "b", and their corresponding cubes "a^3" and "b^3" (using "^" for "power"), then the product of the two cubes would be a^3 times b^3 = (ab)^3. Since the product of "a" and "b" is also an integer, you have the cube of an integer.


Prove that if a and b are rational numbers then a plus b is a rational number?

Because a is rational, there exist integers m and n such that a=m/n. Because b is rational, there exist integers p and q such that b=p/q. Consider a+b. a+b=(m/n)+(p/q)=(mq/nq)+(pn/mq)=(mq+pn)/(nq). (mq+pn) is an integer because the product of two integers is an integer, and the sum of two integers is an integer. nq is an integer since the product of two integers is an integer. Because a+b equals the quotient of two integers, a+b is rational.


Two integers A and B are graphed on a number line. If A is less than B is A always less than B?

Two integers A and B are graphed on a number line. If A is less than B is A always less than B?


How do you write a C program to find the GCD of two given integers using non recursive functions?

Use the following function: int gcd (int a, int b) { while (b != 0) { a %= b; a ^= b ^= a ^= b; } return a; } Note that a ^= b ^= a ^= b is an efficient method of swapping two values.


A number that can be written as a quotent of two integers?

A number that can be written in the form a/b whre a and b are integers is called a rational number.


What is a communitive proberty?

The commutative property refers to a fundamental property of certain operations in mathematics, specifically addition and multiplication. It states that the order in which two numbers are combined does not affect the result; for example, (a + b = b + a) for addition, and (a \times b = b \times a) for multiplication. This property holds true for real numbers, integers, and many other mathematical structures. However, it does not apply to operations like subtraction or division.


What is the meaning of subtracting two integers?

Subtraction means addition of the additive inverse. For two numbers a and b, we say a-b when we mean a + (-b) where -b is a number with the property that b + -b = 0. This applies to all real numbers, which of course includes integers.