Question

In: Computer Science

Write the program that prints the product of 79 and 3.684. The output statement should be...

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++

Solutions

Expert Solution

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


Related Solutions

Write a program that prints out the ASCII number value of a statement or phrase. The...
Write a program that prints out the ASCII number value of a statement or phrase. The user should be prompted to enter a string of text. Then, using a loop, print the ASCII values of each letter in the entered text. Take a screenshot of both your code and your properly executed code after you have run it. Submit the screenshots here along with your .txt file. Hint: The 'ord' and 'chr' functions convert to and from ASCII within python.
Write a program that uses a while statement to read integers from the user and prints...
Write a program that uses a while statement to read integers from the user and prints the sum, average, and largest of these numbers. The input should terminate if the user enters 999. The average should be output with 4 digits of precision. c++ please ASAP
Question #2 Write a program that prints a nicely formatted table of the product of every...
Question #2 Write a program that prints a nicely formatted table of the product of every pair of numbers in a given set of integer numbers. Your program reads two integer numbers x and y that represent the lower and upper bounds of the set, (?≤?x≤y), respectively. Then, for every pair of numbers in this set {?,?+1,?+2,…,?}{x,x+1,x+2,…,y}, your program should compute the product of the two numbers. Please note the following: Your program should read each input (lower bound and...
Write an assembly language program that prints your first name in the output. Use immediate addressing...
Write an assembly language program that prints your first name in the output. Use immediate addressing with a hexadecimal constant to designate the operand of CHARO for each letter of your name. Comment each line except STOP and END. Cut and paste the Assembler Listing into your document and paste a screen shot of the Output area of the Pep8. Use the name "Kevin" as example Assembler Listing Screen Shot of Output area of the Pep8 program
With C code Write a switch statement (not a complete program) which prints an appropriate message...
With C code Write a switch statement (not a complete program) which prints an appropriate message for a letter code entered. Use the following messages: If L is entered, output the message "Lakers" If C is entered, output the message "Clippers" If W is entered, output the message "Warriors" If any other character is entered, output the message "invalid code" Make sure to handle the case where the user enters in a small letter. That is, a capital or small...
Write a program that reads students’ names followed by their test scores. The program should output...
Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and...
Write a program that asks the user for an integer. The program checks and prints to...
Write a program that asks the user for an integer. The program checks and prints to the screen whether the number is prime or not. For example, if user enters 17, the program should print “17 is prime”; if the user enters 20, the program should print “20 is not prime”. please do it with a “ while Loop”, Thanks..
write a program to calculate and print payslips write program that calculates and prints payslips. User...
write a program to calculate and print payslips write program that calculates and prints payslips. User inputs are the name of employee, numbers of hours worked and hourly rate c++ language
Write a C# program that prints a calendar for a given year. Call this program calendar....
Write a C# program that prints a calendar for a given year. Call this program calendar. The program prompts the user for two inputs:       1) The year for which you are generating the calendar.       2) The day of the week that January first is on, you will use the following notation to set the day of the week:            0 Sunday                     1 Monday                   2 Tuesday                   3 Wednesday       4 Thursday                 5 Friday                      6 Saturday Your program should...
Need to write a c program Program prints a message telling the user to push a...
Need to write a c program Program prints a message telling the user to push a key to start the game. Once in game, output tells the player which key to push. The key to press should be determined randomly. Game runs continuously until the user reaches a loose condition. A wrong key is pressed
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT