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
sergij07 [2.7K]
3 years ago
11

Consider the following C program: int fun(int *i) { *i += 5; return 4; } 352 Chapter 7 Expressions and Assignment Statements voi

d main() { int x = 3; x = x + fun(&x); } What is the value of x after the assignment statement in main, assuming a. operands are evaluated left to right. b. operands are evaluated right to left
Computers and Technology
1 answer:
Musya8 [376]3 years ago
4 0

Answer:

a. operands are evaluated left toright. 7

b. operands are evaluated right toleft. 12

Explanation:

a. operands are evaluated left toright. 7

b. operands are evaluated right toleft. 12

left to right

int fun (int *i) {

*i +=5; we add 5to x making x 8

return4; we return 4 tomain

}

void main ( ) {

int x = 3;

x = x + fun(&x); x starts at 3 in fun it ischanged to 8 but the 3 is already being used the 4 fromfun is added (3+4) to it making it 7

}

right toleft x starts at 3 in fun x gets changed to 8 and fun is returned as 4so we have 4 + 8 = 12

Paraphrasing

left to right it's is 3 + 4 =7 original value of x is used

right to left it is 4 + 8 =12 x is used as it was changed by fun, since fun was alreadyexecuted

You might be interested in
Or operator of boolean algebra is denoted by:<br>*<br>+<br>-<br>.​
OlgaM077 [116]

Answer:

or operator is denoted by + sign

7 0
3 years ago
If you did not want the header to appear on the first page of a document but you do want it on all the other pages,
Alinara [238K]

Answer:

I would go to google doc

4 0
3 years ago
Write a program which takes a string input, converts it to lower case, then prints the same string with all vowels (a, e, i, o,
kondor19780726 [428]

import java.util.Scanner;

public class JavaApplication66 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter String:");

       String vowels = "aeiou";

       String text = scan.nextLine();

       text = text.toLowerCase();

       String newText = "";

       

       for (int i = 0; i < text.length(); i++){

           char c = text.charAt(i);

           if (vowels.indexOf(c) == -1){

               newText += c;

           }

       }

       System.out.println(newText);

   }

   

}

This works for me. Best of luck.

8 0
3 years ago
Read 2 more answers
The variable myFirstName needs to store a user's first name. What data type should it be
Thepotemich [5.8K]

Answer:

In terms of the data type it would most likely be a String and not a Boolean and or a Number.

8 0
3 years ago
_______ refers to physical computer equipment, such as the computer monitor, central processing unit, or keyboard.
lesya692 [45]
The Hardware refers to the physical computer equipment, such as the monitor, keyboard, mouse etc.
5 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    10·1 answer
  • Interactive media professionals are unique among other Information Technology professionals because they
    7·1 answer
  • Devices inserted into a computer that give it added capabilities
    13·1 answer
  • :3 Brainlsit included! =) 33 points!
    10·1 answer
  • A company accidentally sends a newsletter with a mistyped website address. The address points to a website that has been spoofed
    8·1 answer
  • ask user to input a string. (assume length of input string is 1) If the string is lower case, print its upper case If the string
    7·1 answer
  • 10. Question<br> Which statement is true about computer security?
    14·1 answer
  • The D:\ drive in your computer has been formatted with NTFS. The Mary user account has been assigned the following permissions:
    10·1 answer
  • Test if the word mold is stored in the variable word. Computer science.
    9·1 answer
  • Help me with this…… please
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!