1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksley [76]
3 years ago
5

Given the following expressions, what value would they have in a C++ program?

Computers and Technology
1 answer:
mario62 [17]3 years ago
5 0

Answer:

The program of the given expressions can be given as  

Program:

#include <iostream>

using namespace std;

int main()                         //define main function.

{

float a,b,c,d,e,f,g,h;                     //define variable for hold values.

a=13 / 4;

cout<<"a:"<<a<<endl;           //print value.

b= 2 + 12 / 4;

cout<<"b:"<<b<<endl;       //print value.

c=21 % 5;

cout<<"c:"<<c<<endl;       //print value.

d=3 - 5 % 7;

cout<<"d:"<<d<<endl;      //print value.

e=17.0 / 4;

cout<<"e:"<<e<<endl;      //print value.

f=8 - 5 * 2.0;

cout<<"f:"<<f<<endl;              //print value.

g=4 + 5 % 2 - 3;

cout<<"g:"<<g<<endl;             //print value.

h=15.0 + 3.0 / 2.0;

cout<<"h:"<<h<<endl;            //print value.

   return 0;

}

output:

a=3.

b=5.

c=1.

d=-2.

e=4.25.

f=-2.

g=2.

h=16.5.

Explanation:

In the above expression, all the options follow the bodmos rules. All the expression explanation can be given as:

In option(a) we divide the value.It gives the quotient.

In option(b) we first divide the value and then addition.

In option(c) we Modulus the value. It gives the remainder.

In option(d) we first Modulus the value and then Subtract It.

In option(e) we divide the value.It gives the quotient.

In option(f) we first multiply the value and then Subtract It.

In option(g) we first Modulus the value, second addition than subtraction.

In option(h) we first divide the value and then addition.

You might be interested in
__________ was awarded the Nobel Prize in physics forhis work on the photoelectric effect.
vekshin1

Answer:

Albert Einstein

Explanation:

Hello, great question. It is always good to ask questions and get rid of any doubts.

Albert Einstein was awarded the <u><em>Nobel Peace Prize</em></u> for his work on Photoelectric Effect in the year 1921. Albert Einstein was a physicist who was born in Germany in 1955, and dedicated his life to science. Largely known for his discovery of the <em><u>General Theory of Relativity</u></em>. Einstein won the Nobel Peace prize for discovering that light are formed in packets of energy that travel at in different frequencies or wave lengths.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

8 0
3 years ago
Which of these engine components forms a tight seal between the piston and the cylinder and is necessary for proper engine opera
TEA [102]
<h2>Piston rings help form a tight seal between the piston and cylinder.   Answer is A. Piston ring</h2>
5 0
3 years ago
Read 2 more answers
Subscript numbering always starts at what value?
Leni [432]
It always starts with 0
4 0
3 years ago
Write a program to display MPH (Miles per Hour). Create a function to calculate the MPH. Ask the user for the number of miles dr
puteri [66]

Answer:

In Python:

def MPH(miles,minutes):

   mph = round(60 * miles/minutes,1)

   return mph

   

miles = float(input("Miles: "))

minutes = float(input("Minutes: "))

if miles>0 and minutes>0:

   print("MPH: ",MPH(miles,minutes))

else:

   print("Positive inputs only")

Explanation:

This defines the function

def MPH(miles,minutes):

This calculates mph rounded to 1 decimal place

   mph = round(60 * miles/minutes,1)

This returns the calculated mph

   return mph

The main begins here

This gets input for miles    

miles = float(input("Miles: "))

This gets input for minutes

minutes = float(input("Minutes: "))

If miles and minutes are positive

if miles>0 and minutes>0:

This calls the MPH function

   print("MPH: ",MPH(miles,minutes))

If otherwise, this prompts the user for positive inputs

<em>else:</em>

<em>    print("Positive inputs only")</em>

7 0
3 years ago
Paragraph talking about why i chose bill gates
AlekseyPX

Answer:

Bill Gates

Explanation:

Bill Gates is known as one of the richest entrepreneurs in the world. He is responsible for creating the largest computer and technology business in the world, Microsoft. In the company's early days, no one would have thought that it would change both America and the world from that point on.

When Gates first created Microsoft,

Middle class Americans could now purchase a personal computer that would not put a set back in their bank account.As soon as personal computers started hitting the mainstream market, the demand for improvement began. People wanted their machines to boot up faster, have larger memory, have improved programming, and be easier to use. Luckily Gates already knew the people would have these needs, so development was already underway.

7 0
3 years ago
Other questions:
  • "where is a cookie that is created during a web site visit​ stored?"
    9·1 answer
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • Nonverbal communication includes _____.
    9·2 answers
  • Explain the computer according to size​
    10·1 answer
  • Are there any apps in the App Store that allow people to ask a question about any topic and have skilled professionals answer it
    6·1 answer
  • Any action that causes harm to your computer is called a
    15·1 answer
  • Assume that you have the business data in various sources such as Excel, .csv, text files and Access, Oracle databases. Write th
    9·1 answer
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • put together a shopping list of items that a first responder should always have at immediate disposal in a field kit. Using curr
    11·1 answer
  • If “A” represents in binary 10011001, what will be the value of word “CAB”?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!