Write a C++ Program to Multiply two Numbers
Solution:
/* C++ Program to Calculate Multiplication of two Numbers */
#include <iostream>
using namespace std;
int main()
{
double first, second, product;
cout << "Enter 1st number :: ";
cin >> first;
cout << "
Enter 2nd number :: ";
cin >> second;
product = first * second;
cout << "
Product of Two Numbers [ "<<first<<" * "<<second<<" ] = " << product<<"
";
return 0;
}
Output:
/* C++ Program to Calculate Multiplication of two Numbers */
Enter 1st number :: 5
Enter 2nd number :: 8
Product of Two Numbers [ 5 * 8 ] = 40
Process returned 0
| Is This Answer Correct ? | 0 Yes | 0 No |
How would you find out if a linked-list is a cycle or not?
Explain how an exception handler is defined and invoked in a Program.
What is a memory leak c++?
Do vectors start at 0 c++?
Can a function take variable length arguments, if yes, how?
Should the this pointer can be used in the constructor?
How would you use the functions memcpy(), memset(), memmove()?
What is lazy initialization in c++?
Why can’t you call invariants() as the first line of your constructor?
What are the stages in the development cycle?
Describe the syntax of single inheritance in C++?
Why should we use null or zero in a program?