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
zlopas [31]
3 years ago
14

Read two numbers from user input. Then, print the sum of those numbers. Hint -- Copy/paste the following code, then just type co

de where the questions marks are to finish the code. num1

Engineering
1 answer:
Softa [21]3 years ago
4 0

Answer:

I am Providing Answer in C Language Program.

Explanation:

Please find attachment regarding code of taking two numbers input and adding them.

I would like to recommend you please use software which supports C language.

#include <stdio.h>

int main () {

int a, b, sum;

printf ("\ nEnter two no:");

scanf ("% d% d", & d, & e);

sum1 = d + e;

printf ("Sum:% d", sum1);

return (0);

}

You might be interested in
What steel type and ASTM designation is preferred for W-shapes?
Ulleksa [173]

Answer:

The preferred steel type for W-shapes is structural steel and the its preferred ASTM designation is ASTM A992.

Explanation:

The ASTM A992 is a structural steel and it's the most available for w-shapes; besides its availabilty, its ductility improvements makes it the preferred choice; other common designations for this shapes are ASTM A572 Grade 50,0r ASTM A36, but this designations aren't as available as ASTM A992, and it has to be confirmed prior to their specification.

3 0
4 years ago
To convert a whole number to a fraction the number can be written over a denominator of
exis [7]
One

When you convert a whole number into a fraction, you put the whole number as the numerator and the denominator as 1.

Such as 12=12/1 or 5=5/1
7 0
3 years ago
1 // Lab 2 tryIt2A 2 #include 3 using namespace std; 4 5 int main() 6 { int x = 1, y = 3; 7 int X = 2, Y = 4; 8 9 cout &lt;&lt;
padilas [110]

Answer:

Here is the complete program:

#include <iostream>

 using namespace std;    

 int main()

 {  int x = 1, y = 3;  

 int X = 2, Y = 4;  

 cout << "tryIt 2A" <<endl;

   cout << x << y << endl;  

   cout << "x" << "y" << endl;  

   cout << X << " " << Y << endl;

   cout << 2 * x + y << endl;  

   cout << 2 * X + Y << endl;  

   //cout << x + 2*y << endl;  

   cout << "x = ";  

   cout << x;  

   cout << " y = ";  

   cout << y;        

   return 0;

   }

Explanation:

I will explain the code line by line in the comment with each line of code and the output of each cout statement.

  • int x = 1, y = 3;  

This statement assigns value 1 to integer variable x and 3 to int variable y

  • int X = 2, Y = 4;  

This statement assigns value 2 to integer variable X and 4 to int variable Y As C++ is a case sensitive language so variable x and y are different from variables X and Y.

  • cout << "tryIt 2A" <<endl;

This statement has cout which is used to display output on the screen. So the output displayed by this cout statement is:

tryIt2A

  • cout << x << y << endl;  

This statement will print the values stored in x and y variables. So output displayed by cout statement here is 1 and 3. As there is not space or next line specified in the statement so output displayed will look like this:

13

  • cout << "x" << "y" << endl;  

This statement will display x and y but these are not the variable x and y. They are enclosed in double quotation marks so they are treated as strings not variables so the output displayed is:

xy

  • cout << X << " " << Y << endl;

This statement will print the values stored in X and Y variables. So output displayed by cout statement here is 2 and 4. As there is  space " " specified in the statement so 2 and 4 are displayed with a space between them so the output displayed will look like this:

2 4

  • cout << 2 * x + y << endl;  

This statement has an arithmetic operation in which 2 is multiplied by the values stored in variable x and then the result is added by value of y. So  2*1 = 2 and 2 + 3 = 5. So the result produced by this cout statement is:

5

  • cout << 2 * X + Y << endl;  

This will work same as above cout statement but the only difference is that the values of capital X and Y variables are calculated here. So 2 * 2 = 4 and then 4 + 4 = 8. The result produced by this cout statement is:

8

  • //cout << x + 2*y << endl;  

This is a comment because before this statement // is written which is used for single line comment. So compiler ignores comments and will not compile this statement.

  •    cout << "x = ";  

This will display "x = " as it is not variable but it is treated as a line to be displayed on the screen. So cout statement displays:

x =

  • cout << x;

This will print the value stored in x variable as there are no double quotes around x so it is a variable which contains value 1. In the above statement there is no endl so the output of this cout statement is displayed with the output of previous cout statement. So the following line is displayed on screen:

x = 1

  • cout << " y = ";

This will display "y = " as it is not variable but it is treated as a line to be displayed on the screen. In the above statement there is no endl so the output of this cout statement is displayed with the output of previous cout statement. So the following line is displayed on screen

x = 1 y =

  • cout << y;    

This will print the value stored in y variable as there are no double quotes around y so it is a variable which contains value 3. In the above statement there is no endl so the output of this cout statement is displayed with the output of previous cout statement. So the following line is displayed on screen:

x = 1 y = 3

So the output of the entire program along with the program is attached as screenshot.

6 0
4 years ago
Implement the function lastChars() that takes a list of strings as a parameter and prints to the screen the last character of ea
Liono4ka [1.6K]

Answer:

The following program is in C++.

#include <bits/stdc++.h>

using namespace std;

void lastChars(string s)

{

   int l=s.length();

   if(l!=0)

   {

       cout<<"The last character of the string is: "<<s[l-1];

   }

}

int main() {

   string s;//declaring a string..

   getline(cin,s);//taking input of the string..

   lastChars(s);//calling the function..

return 0;

}

Input:-

Alex is going home

Output:-

The last character of the string is: e

Explanation:

In the function lastChars() there is one argument that is a string.I have declared a integer variable l that stores the length of the string.If the length of the string is not 0.Then printing the last character of the string.In the main function I have called the function lastChars() with the string s that is prompted from the user.

8 0
3 years ago
True or False? In the electron flow theory, electrons flow from the positively charged body to the negatively charged body.
kobusy [5.1K]

I think it's false because the theory states that electrons flow from negative to positive. Since electrons are negatively charged, it follows that they are attracted by positively charged bodies and repelled by negatively charged bodies.

3 0
3 years ago
Read 2 more answers
Other questions:
  • The term motion refers to a change in position with respect to a. a specific reference b. the ground c. the center of the Earth
    14·1 answer
  • 1. It is known that there are some disadvantages in the casting of metal materials if the casting rate is high. Contrary to this
    12·1 answer
  • Suppliers(sid: integer, sname: string, address: string)
    9·1 answer
  • The brakes are being bled on a passenger vehicle with a disc/drum brake system. Technician A says that the drums should be remov
    14·1 answer
  • This came off my car earlier today. What is it and what does it do?
    15·2 answers
  • An electron is traveling with initial kinetic energy K in a uniform electric field. The electron comes to rest momentarily after
    12·1 answer
  • Which of the following elements found in fertilizer helps plants produce fruit?
    15·2 answers
  • On a supply and demand graph, equilibrium is the point where
    8·1 answer
  • What is your fav movie? mine is truth or dare.
    10·2 answers
  • when you are performing an advanced filter, in which argument box do you enter the range for the dataset?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!