Question

In: Computer Science

Please! I want the instructions of how to solve it, not the answer. Write a program...

Please! I want the instructions of how to solve it, not the answer.

Write a program that does the following in order: 1. Asks the user to enter a name 2. Asks the user to enter a number “x” 3. Asks the user to enter a number “y” 4. Calculates the sum of “x” and “y” 5. Prints out the number for “x”, “y” and “sum” An example of the program input and output is shown below: Enter your name: Belinda Patton Enter number x: 50 Enter number y: 10 The sum of 50 and 10 is 60

Solutions

Expert Solution

//first take the variables and intialize thier data types

//then using scanf take the inputs from the user

//then sum the numbers by + oprator

//print the sum using printf

#include<stdio.h>
void main()
{
        char a[50];
        int x,y,sum;
        printf("enter name");
        scanf("%s",a);
        printf("enter number x");
        scanf("%d",&x);
        printf("enter number y");
        scanf("%d",&y);
        sum=x+y;
        printf("the sum of %d and %d is %d \n",x,y,sum);
}

please rate my answer....


Related Solutions

​I dont want images of the answer. Please solve here or paste the excel working here...
​I dont want images of the answer. Please solve here or paste the excel working here and not the PNG images. Thanks Potter Company – Variance Analysis "That’s Great! Not only did our salespeople do a good job in meeting the sales budget this year, but our production people did a good job controlling costs as well," said Kimberly Donn, president of Potter Company. "Our $18,300 overall manufacturing cost variance is only 1.2% of the $1,536,000 budgeted cost of products...
I want a new answer please Quality of Life Program 2020 is one of the major...
I want a new answer please Quality of Life Program 2020 is one of the major Programs to attain 2030 vision. The program main focus is to improve the lifestyle of individual, family and the society of Saudi Arabia as a whole, in addition to infrastructure development. For instance, in term of changing the lifestyle, several plans were placed to engage the citizens and residents in entertainment, sport and cultural activities. On the other hand, multiple projects were designed to...
PLEASE SOLVE I WILL RATE AND THUMBS UP Assembly code question Write an LC3 program to...
PLEASE SOLVE I WILL RATE AND THUMBS UP Assembly code question Write an LC3 program to compute the XOR (exclusive OR) operation. The program computes the XOR of two numbers stored in registers R0 and R1 and returns the result in register R3. To test your program, before computing the XOR load the two values from memory locations x4000 (into R0) and x4001 (into R1).
I want to write this program in java. Write a simple airline ticket reservation program in...
I want to write this program in java. Write a simple airline ticket reservation program in java.The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display the passengers. The information is maintained on an alphabetized linked list of names. In a simpler version of the program, assume that tickets are reserved for only one flight. In a fuller version, place no limit...
I need to know how to answer this question only in Excel. Please include instructions, screenshots,...
I need to know how to answer this question only in Excel. Please include instructions, screenshots, etc. in Excel which explain the process (formulas included). TropSun is a leading grower and distributer of fresh citrus products with three large citrus groves scattered around central Florida in the cities of Orlando, Eustis, and Winter Haven. TropSun currently has 275,000 bushels of citrus at the grove in Mt. Dora, 400,000 bushels at the groves in Eustis, and 300,000 bushels at the grove...
I Found a Answer but I want another answer !! please answer During September 2020, due...
I Found a Answer but I want another answer !! please answer During September 2020, due to the very hot weather, the production of tomatoes in the local market in Gaza decreased by 60%. Explain the effect of this factor on the market equilibrium of tomatoes ? using graph Due to the financial crisis the income of government's employees has decreased by 50%, at the same time the number of frozen meat's sellers increased by 20%. Explain the effects of...
I want solve this question step by step, and write by pc Solomon is a principal...
I want solve this question step by step, and write by pc Solomon is a principal engineer at an environmental engineering consulting firm. His main role is to advise clients on what type of action to take when they are faced with risks and liabilities while conducting certain projects. In one case, Solomon had a client that wanted to expand their campus until it was within approximately 50 meters of a marshland. After construction of this extension, however, the client...
TEXT ONLY PLEASE (PLEASE NO PDF OR WRITING) C++ CODE Instructions Write a program that implements...
TEXT ONLY PLEASE (PLEASE NO PDF OR WRITING) C++ CODE Instructions Write a program that implements the algorithm given in Example 1 - 3 (Chapter 1), which determines the monthly wages of a salesperson. The instructions for Example 1 - 3have been posted below for your convenience. Example 1 - 3 Every salesperson has a base salary. The salesperson also receives a bonus at the end of each month, based on the following criteria: If the salesperson has been with...
please I want you to answer this question and most importantly, the answer is not already...
please I want you to answer this question and most importantly, the answer is not already available on this site or other site Course Learning Outcome: Apply Organizational behavior knowledge and skills to manage diversified culture in the organizational settings (Lo 2.2). Essay: Differences in Culture and Diversity at workplace Essay Write an essay about the differences in Culture and Diversity at workplace. Use examples, peer-reviewed journals to support your answer. This essay must be at least 1000-word in length....
How can I solve this in Excel? Please show how to solve it in excel step...
How can I solve this in Excel? Please show how to solve it in excel step by step. 1) Speedy Wheels is a wholesale distributor of bicycles for the western United States. Its Inventory Manager, Ricky Sapolo, is currently reviewing the inventory policy for one popular model — a small, one-speed girl's bicycle that is selling at the rate of 250 per month. The administrative cost for placing an order for this model from the manufacturer is $200 and the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT