English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can someone please give me the code for these:

1) Sum of two numbers
Write a program that stores the integers 62 and 99 in variables, and stores the sum of the these two in a variable named total.

2) Write a program which stores the following numbers in 5 different variables: 28, 32, 37, 24, and 33. The program should calculate the average of the numbers and display it on the screen

3) A division of a company generates 62% of total sales. Based on that percentage, how much will the division make if the entire company made $4.6 million in sales.

2007-09-20 09:43:56 · 2 answers · asked by Anonymous in Education & Reference Homework Help

2 answers

1)

#include
using namespace::std;

int main(void)
{
short iOne = 62, iTwo = 99, total;

total = iOne + iTwo;

cout << "The sum is " << total << endl;

return 0;
}

You ought to be able to get the rest, given this example. If you don't figure out how to do it yourself, you'll never learn the language.

2007-09-20 09:48:37 · answer #1 · answered by Anonymous · 0 0

int x = 62;
int y = 99;
int total = x + y;

-------------

2007-09-20 16:51:42 · answer #2 · answered by gjmb1960 7 · 0 0

fedest.com, questions and answers