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
Lemur [1.5K]
3 years ago
11

Write an algorithm to sum to values

Computers and Technology
1 answer:
Elis [28]3 years ago
5 0

Answer:

There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:

Let a,b be two numbers.

c=a+b;

print(c);

But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:

Let a be the variable where the input numbers are stored.

while(f==1)

{

printf(“Enter number”);

scanf(“Take number into the variable a”);

sum=sum+a;

printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);

scanf(“Take the input into the variable f”);

}

print(Sum)

Explanation:

hi there answer is given mar me as brainliest

You might be interested in
Whats the answer to this question?
Naddika [18.5K]
Eat a a dong dong edi35(
6 0
3 years ago
You are the Emergency Management Director of a small island nation. Your nation has come under Cyber-attack and the attackers ha
kozerog [31]

Answer:

okay actually what are you trying to get an answer for

Explanation:

8 0
2 years ago
Which types of networks cover large geographical areas such as several states? PAN
aleksley [76]

MAN

Explanation:

Metropolitan Area Network

Local Area Network

Wide area Network

7 0
2 years ago
Declare a structure with a type name: Car containing:
OLga [1]

Answer:

C++ code is given below

Explanation:

#include <iostream>

#include <cctype>

#include <string.h>

#include <cstring>

#include <sstream>

using namespace std;

struct Car {

public:    

char reportingMark[5];    

int carNumber;

string kind;

bool loaded;

string destination;

};

void input(Car *);

void output(Car *);

int main() {

Car *T = new Car;    

input(T);

output(T);    

delete T;    

return 0;

}

void input(Car *T)

{

string str, s;

cout << " Enter the reporting mark as a 5 or less character uppercase string: ";

cin >> str;

for (int i = 0; i < str.length(); i++)

T->reportingMark[i] = toupper(str[i]);

cout << " Enter the car number: ";

cin >> T->carNumber;

cout << " Enter the kind: ";

cin >> T->kind;

cout << " Enter the loaded status as true or false: ";

cin >> s;    

istringstream(s) >> boolalpha >> T->loaded;    

if (T->loaded == true) {

cout << " Enter the destination: ";

cin.ignore();

getline(cin, T->destination);

}

else

T->destination = "NONE";    

}

void output(Car *T)

{

cout << " Reporting Mark: " << T->reportingMark;

cout << " Car Number: " << T->carNumber;    

cout << " Kind: " << T->kind;

cout << " Loaded Status: " << boolalpha << T->loaded;

cout << " Destination: " << T->destination << " ";

}

7 0
3 years ago
Every call to a recursive function has its own code and its own set of ____ and local variables
777dan777 [17]

Answer: Parameters

Explanation:

Whenever a call to a recursive function is made, then the function has its own code and its own set of parameters with local variables. These parameters are within the scope of the recursive function. For example while finding the factorial of a number we are given the function with parameter such as int recursive(int n) where int n is a parameter passed into the function.

8 0
2 years ago
Other questions:
  • Drag each storage device to its category.
    7·1 answer
  • Assume that passwords are selected from four-character combinations of 26 alphabeticcharacters. Assume that an adversary is able
    11·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
    14·1 answer
  • Both instructions and data in a digital<br>computer are represented as binary<br>digits. True False​
    13·1 answer
  • Think about the ways new communication technologies can make certain tasks easier for
    13·1 answer
  • You are going to create an Arduino sketch where you have two push buttons, one piezo, one
    10·1 answer
  • HELLLLLLLLPPPPPPPPPPPP HHHHHHHHHEEEEEEEEELLLLLLPPPPPP MEEEEEEEE
    12·2 answers
  • A variable is assigned a value on line 328 of a program. Which of the following must be true in order for the variable to work?
    12·2 answers
  • How does xm satellite deter nonsubscribers from listening to its transmissions? Does this make the radio programing a private go
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!