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]
4 years ago
5

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

Computers and Technology
1 answer:
mario62 [17]4 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
Which disk drive type contains a magnetic HDD with onboard flash memory serving as a non-volatile cache?
Shkiper50 [21]

Answer:

SSHD - Solid State Hybrid Drives

Explanation:

SSHD - Solid State Hybrid Drives -

Hard disk refers to a storage form of device , which uses uses the combination of the fast storage medium like the solid - state drive along with the very higher - capacity hard disk drive .

In the solid state hybrid drives , the combination of the onboard flash memory and the magnetic HDD , which is less expensive than the SSD.

Hence , from the given information of the question ,

The correct term is SSHD - Solid State Hybrid Drives  .

5 0
3 years ago
How many frequencies does a full-duplex qam-64 modem use?
Vsevolod [243]

The answer is 2 frequencies.

A Full-Duplex QAM 64 K Modem uses two frequencies. One frequency is used for upstream and the other for downstream. A variety of common QAM forms are available and include, 16 QAM, 32 QAM, 64 QAM, and 256 QAM. For example, for domestic broadcast use, 64 and 256 QAM are used for cable modem and digital cable TV. The modulation scheme for this modem uses both amplitude and phase.

8 0
4 years ago
Read 2 more answers
Write a program that checks whether a positive number given by an input from the user is greater than 5 and less than 20 with ja
Alona [7]

Answer:

Program written in Java is as follows

See comments for explanations

import java.util.Scanner;

public class CheckRange {

public static void main (String [] args)

{

// This line allows the program accept user input

Scanner input = new Scanner(System.in);

//This line declares variable for user input

int num;

//This line prompts user for input

System.out.print("Number: ");

//This line gets user input

num = input.nextInt();

/* The following if statement checks if the user input is greater than 5 and less than 20 */

if (num > 5 && num <= 20)

{

/* This line is executed if the above condition is true */

System.out.print(num+" is greater than 5 and less than 20");

}

else

{

/*If the condition is not true, this line is executed*/

System.out.print(num+" is not within specified range");

}

// The if condition ends here

}

}

5 0
4 years ago
There are N rectangular buildings standing along the road next to each other. The K-th building is of size H[K] × 1.
Sphinxa [80]

Answer:

# you can write to stdout for debugging purposes, e.g.

# print("this is a debug message")

def solution(H):

   # write your code in Python 3.6

   

   # return area of atmost 2 banners

   # 1 banner

   # maximum height * number of buildings

   single_banner = max(H) * len(H)

   smallest_area = single_banner

   

   

   # 2 banner

   for i in range(1, len(H)):

       double_banner = (max(H[0:i]) * len(H[0:i])) + (max(H[i:]) * len(H[i:]))

       if  double_banner < smallest_area:

           smallest_area = double_banner

   

   return smallest_area

8 0
4 years ago
Plz help me on this one
abruzzese [7]
I can’t see all the answer choices.
8 0
3 years ago
Read 2 more answers
Other questions:
  • If a user’s current directory is /home/mary/project1, which command could she use to move to the etc directory directly under th
    5·1 answer
  • Slmething about device for defrosting windscreen?
    5·1 answer
  • What two factors make up the skills of a good typist
    6·1 answer
  • What does "DVI" stand for?
    13·2 answers
  • 1. Some of the music in the 1960s was used to protest social and political issues. Is music still used as a form of protest? Why
    13·1 answer
  • What permission do users have by default regarding printer access and the ability to manage documents?
    14·1 answer
  • Who initially developed what is now known as the internet?
    5·1 answer
  • Which of the following statements is true of satellite internet access?
    13·1 answer
  • PLEASE HELP!!<br> Would you ever try and get famous off of social media? Why or why not?
    6·2 answers
  • You have imported a library with the birthMonth() function. Based on the API, how many strings are inputed to calculate the birt
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!