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
Hi, I have several computer questions. These refer to the history of the internet. I would like to know if everything we look fo
MaRussiya [10]

<u>Hi dear user! </u>

<u>Hope my answer helps you and solve your queries. </u>

First of all,

ISP which is an acronym of Internet Service Provider, keeps the track of all the activities their users perform through their network.

For eg :-

You have a connection of Airtel, whatever you will access through your Airtel network will always be tracked by your ISP which is Airtel. If you delete your search/download history from your phone/laptop, still it can be seen by Airtel, you cannot delete from there end. Even if you access anything in incognito mode, then your browser does not stores your data but your ISP still can see what all you accessed in incognito mode.

Now coming to your next question,

If you delete your data from your phone or laptop, it is still somewhere saved in the hard drive of that device. The file is deleted from the device but it's hard drive still have that file, and anyone can access to that data by using a certain software but for that, the person will also need your hard drive. There are certain softwares like Disk Drill which is used to recover the hard drive's data.

Hope your queries are resolved !

7 0
3 years ago
WAp to input the radius and print<br> the area of circle
Sergeu [11.5K]

Program:-

\tt r=float(input("Enter\:the\:value\:for\:radius\:of\:circle"))

\tt x=3.14*\:r**2

\tt print("Area\:of\:Circle=\{x\}")

<h3>Sample run:-</h3>

\tt r=3

\tt Area\:of\:the\:circle=28.26

7 0
2 years ago
How does polymorphism enable you to program "in the general" rather than "in the specific"? Discuss the key advantages of progra
barxatty [35]

Answer:

Explanation:

When programming in an OOP language classes are created to represent real-life objects, people, places etc. from the real world. Programming in the general allows you to cut down your code and making it more efficient by applying the same necessary functions to all of the objects that classify under the same category. For example by programming "in the general" and creating an Animal class you can create all of the functions/behaviors that animals tend to have. Then you can apply these functions/behaviors to various animals such as a Cat, Dog, Horse, etc. But if you program in the specific you cannot apply a Cat class to a Dog since they are not the same thing.

4 0
3 years ago
How is the execution speed of machine language compared to that of high-level languages? The execution speed of machine language
Alik [6]

The execution speed of machine language is faster than the execution speed of other languages. Machine or assembly language will execute the fastest as compared to high-level languages. No other language can execute faster than Machine language since instructions are directed straight to the CPU. Other high-level languages often add some non-zero amount of overhead to the execution time, thus, causing some delay.

7 0
3 years ago
Read 2 more answers
A company develops a gaming application that it intends to sell. One of the scenarios that the sales team is concerned about is
Deffense [45]

Answer:

A. Registration technique

7 0
3 years ago
Other questions:
  • Please help?!
    11·2 answers
  • How long does it take to get your alignment fixed?
    6·1 answer
  • There are 55 registers, and total 60 instructions available in a general-purpose computer. The computer allows only 2-address in
    6·1 answer
  • Program documentation _____.
    8·1 answer
  • Vghfthcnbvhghvngjgjvjgkb, kcnjc cnnfjdhd mc Dan Jfhjc cm. Cm n n hdjfjocnkcnd
    10·2 answers
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • What are the possible consequences of intentional virus setting?
    14·1 answer
  • You can insert video by clicking video drop-down menu on the ______ tab.
    15·1 answer
  • What type of access controls allow the owner of a file to grant other users access to it using an access control list
    5·1 answer
  • In cells D6 through D8, enter formulas to calculate the values of the stocks. The formulas should multiply the number of shares
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!