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
sukhopar [10]
3 years ago
9

In which of the following is “y” not equal to 5 after execution? X is equal to 4.

Computers and Technology
1 answer:
Step2247 [10]3 years ago
5 0

Answer:

d) y=x++

Explanation:

In all 3 statements:

y= ++x;

y=x=5;

y=5;

The value of y is equal to 5.

However in the statement y=x++, the value of 5 is equal to value of x prior to the increment operation. The original value of x was 4. So the value of y will be 4. Note that after the statement execution, the value of x will be updated to 5. In effect y=x++ can be visualized as a sequence of following steps:

x=4;

y=x;

x=x+1;

You might be interested in
Write a paragraph expressing how you'd use the computer to enhance your place of work.​
Charra [1.4K]

Answer:

Have water by, have it organized, and have notes by you welcome.

Explanation:

4 0
3 years ago
In the scenario below, select the evaluation factor that is most important.
jasenka [17]

Answer:

A. Connectivity

Explanation:

I just answered this question.

4 0
2 years ago
Which type of portfolio might a young investor who is not afraid of risk choose?
Keith_Richards [23]
i think it would be the investment with high risk and high return such as Stocks.When investing in stock, investor analyze whether a specific company will be doing well in the time of investment (which will increase the market price of the stock) and take a profit from it.
7 0
3 years ago
Write a bool function isPalindrome that takes one string parameter and returns true if that string is a palindrome and false oth
kkurt [141]

Answer:

Here is the bool function isPalindrome:

bool isPalindrome(string s)

{  bool palindrome;      

 int j;

 int len = s.length();

 for (int i =0, j= len-1; i < len/2; i++, j--)  

   if (s[i] == s[j])

     palindrome = true;  

   else

     palindrome = false;

 return palindrome; }

Explanation:

The bool function isPalindrome takes a string as parameter and returns true if the string is a palindrome or false if the string is not palindrome. The string variable s holds the string value. In function isPalindrome, there is a bool type variable palindrome. bool is a data type which is used to hold values true or false which is then stored in the palindrome variable.

Next it is being found that how many characters are there in the input string using length() function which returns the length of the string. The length of the string is stored in int type variable len.

Next the for loop starts which has two variables i and j where i starts at 0 position of the input string and j starts at the last position of the string. These two variables move or traverse along the string this way. i variable stops when half the length of the input string is reached. At the end of every iteration i moves forward by the increment of its value to 1 and j moves backwards by the decrement  of its value to 1.

Every the body of  the loop executes, there is an if condition in the body of the loop which checks if the string is a palindrome. This is checked by matching the character at position/index i with the character at position j of the string. This will continue character by character until the i reached half the length of the input string and if every character in i was matched to every character in j then palindrome = true; statement is executed which returns true as the string is a palindrome otherwise palindrome = false; is returned as the string is not a palindrome.

For taking input string from the user and to check if the function isPalindrome() works correctly a main() function is written which takes input string from the user and reads in variable str calls isPalindrome() function. If the string is palindrome then the cout statement in main() function prints the message: String is a palindrome and if the input string is not a palindrome the the following message is displayed in the output screen: String is not a palindrome

int main()

{

string str;

cout<<"Enter a string: ";

cin>>str;

if(isPalindrome(str))

cout<<"String is a palindrome";

else

cout<<"String is not a palindrome";

}

The screenshot of the program along with the output is attached.

7 0
2 years ago
What is HTML ? <br>Give a small description about html
Genrish500 [490]
Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages.
this information was taken from google
7 0
2 years ago
Read 2 more answers
Other questions:
  • Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
    6·1 answer
  • Which part of the faucet is the aerator?
    13·1 answer
  • The world wide web was originally conceived of as a(n) _____.
    14·1 answer
  • Exchange is defined as the trade of goods between two nations. This phenomena is also known as ___________.
    9·1 answer
  • What is online school like 3 sentences
    8·2 answers
  • What is not an option when a user is exporting contacts to share with others?
    10·1 answer
  • Sales representatives want to capture custom feedback record details related to each Account. The sales reps want to accomplish
    12·1 answer
  • Write a recursive function sumAll that accepts an integer argument and returns the sum of all the integers from 1 up to the numb
    10·1 answer
  • In reference to operating systems, what is spooling? what does it stand for? chegg
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!