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
Tasya [4]
3 years ago
8

A programmer must add 1 to the value stored in the int variable sum. One way is given to get you started. Write two more distinc

t ways to add 1 to the value stored in sum.
Computers and Technology
1 answer:
olganol [36]3 years ago
4 0

Answer:

option 1: sum++

option 2: ++sum

Explanation:

In programming, a variable a container or memory location assigned to a value. The C++ syntax specifies the memory location type of value on the declaration. The major types of variables in C++ are; integer, float, double, char, string, and boolean.

To add 1 to an integer variable, the variable value could be summed with one and assigned to that same variable or '++before' and 'after++' with adds one to the variable before and after the execution of a statement.

You might be interested in
Write a complete function called lowestPosition() which takes as array (of double) and the number of elements used in the array
stiv31 [10]

Answer:

#include <bits/stdc++.h>

using namespace std;

int lowestPosition(double elements[],int n)//function to find position of lowest value element.

{

   int i,pos;

   double min=INT_MAX;

   for(i=0;i<n;i++)

   {

       if(elements[i]<min)

       {

           min=elements[i];

           pos=i;//storing index.

       }

   }

   return pos+1;//returning pos +1 to give the correct position in the array.

}

int main() {

double ele[500];

int n;

cout<<"Enter number of values"<<endl;

cin>>n;

cout<<"Enter elements"<<endl;

for(int i=0;i<n;i++)

{

   cin>>ele[i];

}

int pos=lowestPosition(ele,n);//function call.

cout<<"The position of element with minimum value is "<<pos<<endl;

return 0;

}

Output:-

Enter number of values

5

Enter elements

4 6 7 5 1

The position of element with minimum value is 5

Explanation:

I have created a function lowestPosition() with arguments double array and it's size.I have taken a integer variable pos to store the index and after finding minimum and index i am returning pos+1 just to return correct position in the array.

3 0
4 years ago
What are the differences between switches and routers? cse question
deff fn [24]

Answer:

The main objective of router is to connect various networks simultaneously and it works in network layer

Explanation:

The main objective of router is to connect various networks simultaneously and it works in network layer

7 0
3 years ago
Practising some questions for board exams for class 12 python,pls help with detailed answer
poizon [28]
I do t know the answer to this but i think tou can firger it iut food luck
3 0
3 years ago
To access documents stored on a "cloud", you'll
gregori [183]

Answer:

B

Explanation:

5 0
3 years ago
The total cost of a DUI could be as high as----- dollars?<br> a100<br> b500<br> c1000<br> d8000
Svet_ta [14]
the answer is d because depending on your state's laws they can also and endangerment of self and others 
7 0
4 years ago
Read 2 more answers
Other questions:
  • What are some local storage devices?​
    6·1 answer
  • 1. _____ can’t be rewritten by the computer in which it’s installed, but it has the advantage of being very _____.
    6·1 answer
  • A __________ acts as separate network that rests outside the secure network perimeter so untrusted users can access web servers
    10·1 answer
  • Given a String variable named line1 and given a Scanner reference variable stdin that has been assigned a reference to a Scanner
    11·1 answer
  • C++ Proagram
    7·1 answer
  • Plz answer me will mark as brainliest​
    13·1 answer
  • Join for a pack battle loud microphone.
    10·1 answer
  • This class is missing a number of functions. Rewrite the class declaration to follow best practices, e.g, operators, three impor
    10·1 answer
  • Your agile team only has one database developer. So the other developers finish their tasks and then wait for their work to be I
    6·1 answer
  • ____ takes care of the transport between machines. but it is unreliable, and there is no guarantee that any given packet will ar
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!