What Will Be The Values Of Ans, X, And Y After The Following Statements Are Executed?
What Will Be The Values Of Ans, X, And Y After The Following Statements Are Executed?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What Will Be the Values of Ans, X, And Y After the Following Statements Are Executed?
Int Ans = 35, X = 50, Y = 50;
If (X >= Y)
Ans = X + 10; X -= Y;
Else Ans = Y + 10;
Y += X;
Answer: The value of the Ans, X, and Y after the statement is executed is Ans=60, X=0, and Y=50.
The codes in the programs are the set of instructions given by the users. The instructions given for the codes are different like subtracting the numbers or heck if the value is equal to some condition. The instructions are stored in the form of bytes. as CPU executes 2 billion operations in a second it means the 2 billion codes are executed in the second.
The programs are the combination of the codes which are in bulk amounts. Such as the Firefox is built for the instruction that can add more than two numbers it is difficult to believe but it’s the fact. The programs work when the CPU executes the instruction with the help of the: fetch-execute” cycle. Instructions come in a sequence toward the CPU, they are executed and then the next instruction is executed and the cycle starts. Some lines in the instruction become the reason to distort the order of the CPU. Sometimes there might be an instruction that allows the CPU to move back to the initiation point or to skip the instruction and move to the other one if the given statement is true, and the IF statement work in the scenario. The collection of the machine code makes the programs