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
cluponka [151]
3 years ago
9

What would be the results of the following code? int[] x = { 55, 33, 88, 22, 99, 11, 44, 66, 77 }; int a = 10; if(x[2] > x[5]

) a = 5; else a = 8; A. a = 5 B. a = 8 C. a = 10 D. This is a compilation error, you cannot compare array elements.
Computers and Technology
1 answer:
Nezavi [6.7K]3 years ago
6 0

Answer:

The answer is "Option A".

Explanation:

In the given code an integer array "x" is defined, that stores some elements and another integer variable "a" is declared, that holds a value that is "10". In this code a conditional statement is defined, which checks array element value, in if block element of array that position is 2 is greater then the element of array that position is 5.if this condition is true, so variable a value is change that is equal to 5. In else block if the above condition is not true so the value of a variable is equal to 8, and another options is wrong that can be described as follows:

  • In option B, The given condition is not false, that's why it is not correct.
  • In option C, The value of variable a is changed when condition is true or false, that's why it is not correct.
  • In option D, It is wrong because we can compare array elements.

You might be interested in
What are some options available when using the Replace feature?
3241004551 [841]

Assuming that the user is talking about Microsoft Word, the options available when using the replace feature include replace, replace all, and find next. First, the Find what and Replace with boxes locates a word or phrase and replaces it with the new text. Selecting the replace option will update one instance while the replace all option will update all instances without stopping at each one. You can click on the Find Next several times until you come to the instance that you want to update.

8 0
3 years ago
What is the purpose of the Excel Function Reference?
Citrus2011 [14]

Answer:

To look up functions and their purposes

Explanation:

Edg

3 0
3 years ago
Why do we need the system requirements for Adobe photoshop?
babymother [125]
I’m sorry and I do not know I just need credits thank have a nice day
7 0
3 years ago
Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives.
zhuklara [117]
<span>Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives. 
a. True 
b. False</span>
3 0
3 years ago
If the object instance is created in a user program, then the object instance can access both the public and private members of
rewona [7]

Answer:

False

Explanation:

The private member of a class is not accessible by using the Dot notation ,however the private member are those which are not accessible inside the class they are accessible outside the class  .The public member are accessible inside the class so they are accessible by using the dot operator .

<u>Following are the example is given below in C++ Language </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {     return 3.14*r*r;  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 3.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Output:

compile time error is generated

<u>The correct program to access the private member of class is given below </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {    

r1=r;

double t2=3.14*r2*r2;

return(t2); // return the value  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 1.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Therefore the given statement is False

5 0
3 years ago
Other questions:
  • Which does an icon on the desktop signify?
    12·1 answer
  • Which option is used to apply formatting to multiple objects on a single slide while still maintaining the ability to manage the
    14·2 answers
  • How many address bits are needed to specify each byte in a 512 byte memory unit?
    5·1 answer
  • Oiê gentee, bom dia O que você entende por cultura digital ??
    12·1 answer
  • Which network media uses different regions of the electromagnetic spectrum to transmit signals through air?
    13·1 answer
  • A(n) _____ is a request for the database management software to search the database for data that match criteria specified by th
    15·2 answers
  • Consider a disk that rotates at 3600 rpm. The seek time to move the head between adjacent tracks is 2 ms. There are 32 sectors p
    5·1 answer
  • The underlying color of a slide.
    9·1 answer
  • What is an example of work performed by an integration platform as a service (ipaas)?
    14·2 answers
  • The technologist has recorded the red cell morphology as macrocytic. which mcv value would confirm this observation?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!