answersLogoWhite

0


Best Answer

#include<iostream>

int main()

{

std::cout << "Enter two numbers: ";

double a, b;

std::cin >> a >> b; // note: error handling omitted for brevity!

std::cout <<"The product of " << a << " and " << b << " is " << a*b << '\n';

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a cpp program to multiply two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program in c plus plus to implement macro processor?

Don't write, it is already written, google for 'cpp'.


Write a program in cpp to print the charminar?

int main (void) { puts ("charminar"); return 0; }


CPP Program for Implementing Knuth-morris-pratt pattern matching algorithm?

what is the pure algorithm instead of cpp program?


A program without an extension name CPP will run?

Yes because a program can run without a CPP extension, especially if program extension is .exe


How do you write a program to illustrate the concept of extern variable?

In order to use extern you have to have at least two files. In first one, let's call it file1.cpp, you will define a variable using extern (in this case belongs to int):...extern int myVar = 0;...Then in file2.cpp file where you have main() you need to write following:extern int myVar;Do not initialize the variable in file2.cpp, or you code will not compile.


Explain a program for this pointer in cpp?

Go to the link. You will got use of "this" keywork with simple explanation and example. http://cpp.codenewbie.com/articles/cpp/1527/Keyword_this-Page_5.html


How to print the code of a program in the output terminal when the program is being executed in cpp?

Such a program is called a Quine. http://en.wikipedia.org/wiki/Quine_(computing)


What c plus plus program must be saved in a text with the extension cpp?

The .cpp extension is merely conventional; it is not required by the C++ standard. You can actually use any file extension you wish.


Why the extension cpp of c?

The extension of a file containing a C program can be any extension, so long as the compiler or platform can infer the proper rules to build it. Commonly, for C programs, the extension is .c, so myfile.c would be a C program. The term cpp is not a designation for C++. It means C Program Precompiler, and it is the normal way to build one or more C programs into an executable. Over the years, cpp has evolved into being able to handle all sorts of languages. C++ is one of them. Typical extensions for C++ programs are .cc, .cpp, and .cxx.


Will particular C program be compatible for both g c c and DEV Cpp compiler?

That is possible. Try it.


What do the initials CBF and CPP stand for?

CPP


How do you write a program to print Fibonacci series of n numbers using recursion in cpp?

#include&lt;iostream&gt; unsigned fib (unsigned term, unsigned a=0, unsigned b=1) { if (term&lt;1) return a; return fib (--term, a+b, a); } int main() { std::cout &lt;&lt; "Fibonacci (1000th term): " &lt;&lt; fib (1000) &lt;&lt; std::endl; }