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
andrezito [222]
3 years ago
5

What is the output for the code below?

Computers and Technology
1 answer:
alisha [4.7K]3 years ago
5 0
What is output by the code below? int[] array = {33,14,37,11,27,4,6,2,6,7}; System .out.println(array.length); ... int[] array = {5,10,3,6,9,15}; ... int total = 0; ... output by the code below? int j=1, tally=0; while(j<9) { tally++; j++; } System.out.print(tally);.
From quizlet
You might be interested in
C++ Language Use functions to solve all problems in the mentioned assignment
alexdok [17]

Answer:

Following are the program to this question:

Q1:

#include <iostream> //including header file

using namespace std;

int main() //defining main method

{

   int m,n,i; //defining integer variable

   cout<<"Enter starting value: "; //print message

   cin>>m; //input m variable value

   cout<<"Enter ending value: ";//print message

   cin>>n;//input n variable value

   for(i=m;i<=n;i++) //defining loop to count even number  

   {

       if(i%2==0) //check even number condition

       {

           cout<<i<<" "; //print value

       }

   }

   return 0;

}

Q2:

#include<iostream> //include header file

using namespace std;

void menu() //define method menu

{

cout<<"Enter 1 for print your name and id: "<<endl; //print message

cout<<"Enter 2 for sum of odd numbers from 1 to 20: "<<endl;//print message

cout<<"Enter 3 for reverse of any number: "<<endl;//print message

cout<<"Enter 4 for exit"<<endl;//print message

}

void findsum() //define method findsum

{

int s=0,i; //defining integer variable

for(i=1;i<=20;i++) //defining loop to count odd number  

{

s=s+i; //add numbers

}

cout<<"Odd number sum from 1 to 20: "<<s; //print value

}

void revers() //defining method revers

{

int n,r,rev=0; //defining integer variable

cout<<"enter any number: "; //print message

cin>>n; //input value

while(n!=0) //define loop to reverse value

{

r=n%10; //store value in r variable

rev=(rev*10)+r; //add reverse value

n=n/10; //divide digit

}

cout<<"The reverse of a given number is: "<<rev; //print reverse value

}

int main() //defining main method

{

int c,rn; //defining integer variable

char n[30]; // defining char variable

menu(); //calling menu method

cout<<"Enter your selected choice: "<<endl; //print message

cin>>c; //input value in char variable

switch(c) //defining switch

{

   //defining case

case 1: cout<<"Enter your name: "<<endl; //print message for input name and id  

       cin>>n;//input name

       cout<<"Enter registration number: "<<endl; //print message  

       cout<<"Name: "<<n<<endl; // print name value

       cout<<"Registration number: "<<rn<<endl; // print id value

   break;

case 2: findsum(); //calling findsum method

   break;

case 3: revers(); //calling reverse method

   break;

case 4: exit(1); // calling exit method

   break;

default: cout<<"please enter valid choice"; //defining default choice

   break;

}

return 0;

}

Q3:

#include <iostream>//defining header file

using namespace std;

void reverse() //defining method readInput

{

  char x; //defining char variable

  cout<<"Enter a character: "; //print message

  cin>>x; //input value

  if(x=='.') //defining condition that check value is .  

   return; //using return keyword

  reverse(); //calling readInput method

  cout<<x; //print value

}

int main() //defining main method

{

  reverse(); //calling readInput method

return 0;    

}

Output:

please find the attachment.

Explanation:

Description of the given question as follows:

  • In question 1, three integer variable "m, n and i" is declared, in which variable "m and n" is used in user input, and variable "i" is used a loop to print even number from the user input values.
  • In question 2, a menu method is declared that prints a list menus in the next line, two methods "findsum() and revers()"is declared, in which "findsum" method is used to add odd values from 1 to 20 and the revers method is used to reverse value from an input digit. In the last line main method is declared, which uses switch to call the above methods.
  • In question 3, in this, a reverse method is defined, in which a char variable x is declared that input char value and define if block to check if char is equal to (.) if this is correct it will print the value in reverse order.

7 0
3 years ago
_____ are shown on an assembly drawing to reference parts to the parts list.
AveGali [126]
Mother board circuit assembly
5 0
4 years ago
It is a single strand of metal capable of transmitting power or data from one area to<br> another
Lera25 [3.4K]

Answer: A wire

Explanation:

8 0
3 years ago
A batholith is an example of a(n) _____ igneous rock (one of the two main igneous rock groups).
Naily [24]
A batholith is an intrusive igneous rock.
3 0
4 years ago
Read 2 more answers
A threat actor has successfully breached the network firewall without being detected by the IDS system. What condition describes
Mamont248 [21]

Answer:

false negative

Explanation:

A false negative is a dangerous state in which the IDS (Intrusion Detection System) assumes the activity as acceptable in which the activity is actually an attack occurred on the system.

That means, the Intrusion Detection System has failed to catch the attack. This is the most dangerous state, as the systems were compromised and the network or cyber security people were unable to find the attack.

More generally, there are two types of Intrusion Detection Systems ( IDS ). Network based IDSs ( NIDS ) and Host based IDSs ( HIDS ).

5 0
4 years ago
Other questions:
  • The ________ defines every object and element on a web page.
    13·1 answer
  • Which microphones are considered to have the best quality?
    12·2 answers
  • A(n) _____ might be written by a programmer or it might be created through a DBMS utility program.
    6·1 answer
  • Computer architecture:
    6·1 answer
  • Suppose an initially empty stack S has performed a total of 15 push operations, 12 top operations, and 13 pop operations ( 3 of
    5·1 answer
  • 9. Which of the following commands is executed with the shortcut 'Ctrl+Z'?
    11·1 answer
  • Logan has developed an excellent presentation with interesting content. He received great feedback on the evaluation
    10·1 answer
  • A server malfunction has been resolved after replacing a failed hard drive. Enterprise services have been restored. What is the
    5·1 answer
  • python. create a program that asks the user to input their first name and their favorite number. Then the program should output
    12·1 answer
  • Write an SQL query to list all the records from the member and branch tables.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!