Question

C programming Given an integer variable declared as int result, which of the following choices set...

C programming

Given an integer variable declared as int result, which of the following choices set result = 2?  Each choice may contain a single statement or a group of statements. Select all choices you believe are correct--this question may have more than one correct answer!

A.
double temp = 19.0;
int div = 10;

result = 1 + temp / div;
B.
double val1 = 3;
double val2 = 0.75;

result = val1 / 2 + val2 * 2;
C.
int x = 3;
int y = 4;
int z = 10;

result = ( (z - y) * (x * y) - 2) / (z * 2);
D.
result = 16 % 7;
E.
result = 16 / 7;
0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
C programming Given an integer variable declared as int result, which of the following choices set...
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
  • Hello, please correct the following C++ CODE it is not working on visual studio: (I WILL RATE, NO...

    Hello, please correct the following C++ CODE it is not working on visual studio: (I WILL RATE, NO INCOMPLETE OR WRONG SOLUTIONS PLEASE) // CPP program to evaluate a given // expression where tokens are // separated by space. #include using namespace std; // Function to find precedence of // operators. int precedence(char op){ if(op == '+'||op == '-') return 1; if(op == '*'||op == '/') return 2; return 0; } // Function to perform arithmetic operations. int applyOp(int a,...

  • An integer overflow is the condition that occurs when the result of an arithmetic operation, such...

    An integer overflow is the condition that occurs when the result of an arithmetic operation, such as multiplication or addition, exceeds the maximum size of the integer type used to store it. If the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value. It is often a critical security flaw in software. For example, in a 16-bit integer system, 19458*37=64586. The result...

  • C++ 4. (5 points) Identify the following items in the programming code shown below: a. Function...

    C++ 4. (5 points) Identify the following items in the programming code shown below: a. Function prototype, function heading, function body, and function definitions. b. Function call statements, formal parameters, and actual parameters. C. Value parameters and reference parameters. d. Local variables and global variables. 6. Named constants. #include <iostream> //Line 1 using namespace std; //Line 2 const double NUM = 3.5; //Line 3 int temp; //Line 4 void func(int, doubles, char); //Line 5 int main() int num; double one;...

  • C++ 1. A?B?C?D? which one is correct 2. 3A, 3B #include<iostream> using namespace std; void swap0(int*...

    C++ 1. A?B?C?D? which one is correct 2. 3A, 3B #include<iostream> using namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap1(int ptri, int ptr2){ int temp; temp = ptri; ptr1 = ptr2; ptr2 = temp; portion void swap2(int *&ptri, int *&ptr2){ int* temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap3(int &ptri, int &ptr2) { int temp; temp = ptr1; ptr1 = ptr2; ptr2 =...

  • Given the following code segment, int x = 20; int y = 7; what is the...

    Given the following code segment, int x = 20; int y = 7; what is the data type of the value of the expression (x % y) ? (3 points) Question 1 options: 1) int 2) double 3) numeric 4) Error: possible loss of precision 5) Unable to be determined Question 2 (3 points) Given the following code segment, double x = 42.3; double y = 11.7; what is the data type of the value of the expression (x %...

  • Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to...

    Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. a -31 es" (a%b) * 6; e-(a b+ d)/ 4 10. Which of the following variable declarations are correct? If'a variable declaration is not correct, give the reasoníy) and provide the correct variable declaration. n = 12; char letter int one = 5, two; //Line 3 double x, Y zi //tine...

  • C Programming QUESTION 2 Which of the following statements about pointer arguments are true? Select all...

    C Programming QUESTION 2 Which of the following statements about pointer arguments are true? Select all choices you believe are correct--this question may have more than one correct answer! A. The * operator allows you to access the address of an existing variable, while the & operator allows you to dereference a pointer and access the data to which it points. B. A function with pointer arguments must have the void return type. C. Pointer arguments allow you to write...

  • Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double...

    Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...

  • 81. The following function call doesn’t agree with its prototype:              cout << BoxVolume( 10, 5...

    81. The following function call doesn’t agree with its prototype:              cout << BoxVolume( 10, 5 );                    int BoxVolume(int length = {1}, int width = {1}, int height = {1});                                                     T__   F__                                                                     82. The following function is implemented to swap in memory the          argument-values passed to it:         void swap(int a, int b)                   {           int temp;             temp = a;             a = b;             b = temp;        ...

  • Java Questions When creating a for loop, which statement will correctly initialize more than one variable?...

    Java Questions When creating a for loop, which statement will correctly initialize more than one variable? a. for a=1, b=2 c. for(a=1, b=2) b. for(a=1; b=2) d. for(a = 1&& b = 2) A method employee() is returning a double value. Which of the following is the correct way of defining this method? public double employee()                                    c. public int employee() public double employee(int t)                  d. public void employee() The ____ statement is useful when you need to test a...

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