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
Vladimir79 [104]
3 years ago
5

Write a statement that increases the value of the int variable total by the value of the int variable amount. that is, add the v

alue of amount to total and assign the result to total.
Computers and Technology
1 answer:
sp2606 [1]3 years ago
6 0
Total += amount

If your language does not support that, just use

total = total + amount
You might be interested in
Write the definition of a function divide that takes four arguments and returns no value . The first two arguments are of type i
Nastasia [14]

Answer:

#include <iostream>

using namespace std;

void divide(int numerator, int denominator, int *quotient, int *remainder)

{

*quotient = (int)(numerator / denominator);

*remainder = numerator % denominator;

}

int main()

{

int num = 42, den = 5, quotient=0, remainder=0;

divide(num, den, &quotient, &remainder);

 

return 0;

}

Explanation:

The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.

To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.

Thanks! :)

8 0
3 years ago
Complete this truth Table. Write a program that you can enter from the keyboard, a 1 or 0 into three Boolean variables, A,B,C. W
SSSSS [86.1K]

Answer:

Following are the code to this question:

#include<stdio.h>//defining header file

int AND(int x,int y) //defining a method AND that hold two variable in its parameter

{

if(x==1 && y==1)//defining if block to check x and y value is equal to 1

{

return 1;//return value 1

}

else //defining else block

{

   return 0;//return value 0

}

}

int OR(int x,int y)//defining method OR that hold two variable in its parameter

{

if(x==0&&y==0)//defining if block to check x and y value is equal to 1

{

return 0;//return value 0

}

else //defining else block

{

   return 1;//return value 1

}

}

int main()//defining main method

{

int a,b,c;//defining integer variable  

int k=1;//defining integer variable k that holds a value 1

while(k<=8)//defining while loop for 8 time input

{

printf("Please insert 3 numbers in (0 0r 1):\n ");//print message

scanf("%d%d%d", &a, &b, &c);//input value

k++;//increment the value of k by 1

printf("value: %d\n",AND(OR(a,b),c));

}

return 0;

}

Output:

please find the attachment.

Explanation:

In the above-given C language code two methods "AND and OR" is declared, holds two integer variable "x and y" in its parameters, inside the method a conditional it used that can be defined as follows:

  • In the AND method, inside a conditional statement, if block check x and y both value is same that is 1 it will return 1 or it will goto else block in this it will return value 0.      
  • In the OR method, inside a conditional statement, if block check x and y both value is the same, that is 0 it will return 0 or it will goto else block in this it will return value 1.
  • In the main method, four integers "a,b,c, and k" is declared in which variable "a, b, c" is used in the loop for 8 times input values from the user and print method is used to call the method and prints its return values.

8 0
3 years ago
An independent computer program that copies itself from one computer to another over a network is called a ____:
Komok [63]
The answer is trojan horse.
4 0
3 years ago
The beginning balance of Keyshawn's savings account for the month of September was $3900, and it remained this way for the first
Doss [256]
I’m not gonna wanna was that 638
4 0
3 years ago
Compare the four ways of regulating the internet​
Bas_tet [7]

Answer:

the four is all the same way that can harm people through the internet

Explanation:

7 0
3 years ago
Other questions:
  • The color band that represents tolerance on a resistor is the?
    11·1 answer
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • Georgenotfound??? question mark??
    15·2 answers
  • If you want to conserve ink or toner, you can instruct powerpoint to print ____ documents.
    6·1 answer
  • The command prompt found on Windows 7 and Windows 8 is very similar to the interface of what past operating system?
    5·1 answer
  • An organization's Finance Director is convinced special malware is responsible for targeting and infecting the finance departmen
    13·1 answer
  • What is the family access code right now?
    5·1 answer
  • Suppose you are working as an administrative assistant at a small law firm. Your boss has asked you to send an invitation out to
    5·1 answer
  • Margie has found a stock template to use. She changes a few things about the formatting and then saves the
    7·2 answers
  • What is microsoft excel​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!