In: Computer Science
Write the program that prints the product of 79 and 3.684. The output statement should be descriptive, and should include the printing of all three variables (the two operands as well as the product). Write In C++
Write the program that prints the product of 79 and 3.684 he output statement should be descriptive, and should include the printing of all three variables (the two operands as well as the product). Write In C++..
#include<iostream>//libraries
using namespace std;//
int main() //main fuction
{
int n = 79,m = 3.684,q; //assigning values to variables or
operands
cout <<"the product of 79 and 3.684 is "; //just string what
is going on
q = (n*m); // logic for product of two variables assigned to
another variable or product
cout << n<< "*"<<m<<"="<< q<<
endl; // printing the all three variables.
return 0;
}
output:
the product of 79 and 3.684 is 79*3.684 = 237
Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. von * * *** **** ************************************************************* 8 #include <iostream>//header 9 using namespace std; 10 int main() 7/main fuction 11 int n = 79,- = 3.684,9://assigning values to variables cout <<"the product of 79 and 3.684 is "://just string 14 q = (nºm);// Logic for product of two variables assigned to another variable cout <<n<<"*" << < " = " << << endl; // printing the all three variables. 12 return 0; the product of 79 and 3.684 1879 3 = 237