Question

In C++, Create an int variable called first and fill it with a whole number taken...

In C++, Create an int variable called first and fill it with a whole number taken from the keyboard. Create another int variable called second. Output the sum of first and second, product of first and second, difference of first and second, and the modulus of first and second.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANS :H includi < bits/stdc4th int mainい nt FirstDeclarahon of vanabu cr>〉 first: 1/ whole numbe token from int second I/ nam

Add a comment
Know the answer?
Add Answer to:
In C++, Create an int variable called first and fill it with a whole number taken...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Must be written in VBA Create a program called moremath to request a whole number, n,...

    Must be written in VBA Create a program called moremath to request a whole number, n, from 1 to 30, and one of the letters S or P. Then, depending upon whether S or P was selected, calculate the sum or product of the numbers from 1 to n.

  • Create a structure called employee that contains two members: an employee number (type int) and the...

    Create a structure called employee that contains two members: an employee number (type int) and the employee’s compensation (in dollars; type float). Ask the user to fill in this data for three employees, store it in three variables of type struct employee, and then display the information for each employee.

  • In the Source Folder (src) of this project create a new C source file called "gcd.c"....

    In the Source Folder (src) of this project create a new C source file called "gcd.c". Once again, copy the contents of the "main.c" file above into the "gcd.c" source file. Modify this program to NOT ask the user to input the second Positive Integer, if the user has entered a program terminating value for the "first" input Postitive Integer. #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { //============================== setbuf(stdout, NULL); // turns standard output buffering off int...

  • Create a program which asks for two numbers. The first number should be a decimal number...

    Create a program which asks for two numbers. The first number should be a decimal number the second should be a whole number. The first number needs to be raised to the power of the second number. The answer should be formatted with two digits after the decimal. The output should look like the example output given. You may use your own data but output needs to be formatted same way. Pow() function should be used correctly in program. Its...

  • In C++ Write a function called fillArray that will fill an array of any constantly declared...

    In C++ Write a function called fillArray that will fill an array of any constantly declared array size variable with random numbers in the range of 1 - 100. Write a function called printArray that will print an array of any size. Write a third function called countEvens which will count and return the number of even numbers in the array. In main create an array that holds 25 ints. Use your functions to fill, print, and count the number...

  • Question 27 The following statement ________. cin >> *num3; stores the keyboard input in the variable...

    Question 27 The following statement ________. cin >> *num3; stores the keyboard input in the variable num3 stores the keyboard input into the pointer num3 is illegal in C++ stores the keyboard input into the variable pointed to by num3 None of these Question 28 The following statement ________. int *ptr = new int; results in a compiler error assigns an integer less than 32767 to the variable ptr assigns an address to the variable ptr creates a new pointer...

  • Write a non-void method named sum that is passed two int parameters when it is called....

    Write a non-void method named sum that is passed two int parameters when it is called. It then uses a for-loop to compute and return the value of the sum of all the numbers between the value of the first parameter and the second, inclusive. This method does not display anything. Give an example of how this method would be called, to produce output

  • Create two Java classes called Recursive, RecursiveDemo. Write four methods a- int sum_sqr_rec(stack<int> stk) which will...

    Create two Java classes called Recursive, RecursiveDemo. Write four methods a- int sum_sqr_rec(stack<int> stk) which will receive a stack of "int" and output the sum of the squares of the elements in the stack. b- int plus_minus_rec(stack<int> stk) which will receive a stack of "int" (example: {a,b,c,d,e,f,g,h,i,j}) and output the sum of the elements in the stack as follows: a - b + c - d + e - f + g - h + i -j c- void prt_chars_rev_rec(stack<char>...

  • Create a class called Play that has an InputReader as an instance variable. Be sure to...

    Create a class called Play that has an InputReader as an instance variable. Be sure to initialize it in the constructor. The class has two methods. Write a method with this signature: Write a method with this signature: public void stringPlay() The method prompts the user for a string, reads it in, and then displays the string as many times as the length of that string. The output string should be formatted with the first letter uppercase and the rest...

  • c++ I am suppose to write a function that gets a number from a user, say...

    c++ I am suppose to write a function that gets a number from a user, say 3.123456789 and then the program gets another number from the user which is used to find out how many decimal digits we want rounded to. So if the user inputs 3 then the number would turn into 3.123 then we are suppose to add two digits next to the rounded number so it would turn into 3.12300. the rounding is suppose to be done...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT