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
Artist 52 [7]
3 years ago
13

Which of the following correctly illustrates how to output something to the console in C#?

Computers and Technology
1 answer:
Arte-miy333 [17]3 years ago
7 0
Console.WriteLine("Hello World!");
You might be interested in
Assume that strikeCounter has already been declared to be a "pointer to int". Assume further that strikeCounter has been initial
Feliz [49]

Answer:

int* strikeCounter ;

int someVal;

scanf("%d", &someVal);

strikeCounter =&someVal;

*strikeCounter =someVal*4;

Explanation:

Here we took one int variable and read that value from user. we assigned that int variable address to pointer variable "strikeCounter " and we are pointing the value of strikecounter as 4 times of that integer variable value

8 0
3 years ago
A_____refers to the entire Excel file
Veronika [31]
Answer:  workbook

Explanation:
A workbook is the file that holds several worksheets.
The worksheets within a workbook can communicate with each other within the workbook or with other workbooks and their worksheets.
A worksheet within a workbook holds cells that are defined by rows and columns. Worksheets within a workbook can removed and new worksheets can be added.
8 0
3 years ago
in java how do i Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
hammer [34]

Answer:

Here is the JAVA program:

import java.util.Scanner; //to take input from user

public class Main{

public static void main(String[] args) { //start of main function

Scanner input = new Scanner(System.in); // creates Scanner class object  

       int num, integer, odd = 0, even = 0; //declare variables

       System.out.print("Enter the number of integers: "); //prompts user to enter number of integers

       num = input.nextInt(); //reads value of num from user

       System.out.print("Enter the integers:\n"); //prompts user to enter the integers

       for (int i = 0; i < num; i++) { //iterates through each input integer

           integer = input.nextInt(); // reads each integer value

               if (integer % 2 == 0) //if integer value is completely divisible by 2

                   even += integer; //adds even integers

               else //if integer value is not completely divisible by 2

                   odd += integer;  } //adds odd integers

           System.out.print("Sum of Even Numbers: " + even); //prints the sum of even integers

           System.out.print("\nSum of Odd Numbers: " + odd);//prints the sum of odd integers

           }}

Explanation:

The program is explained in the comments mentioned with each line of the code. I will explain the logic of the program with the help of an example.

Suppose user wants to input 5 integers. So,

num = 5

Suppose the input integers are:

1, 2 , 3, 4, 5

for (int i = 0; i < num; i++)  is a for loop that has a variable i initialized to 0. The condition i<num is true because i=0 and num=5 so 0<5. Hence the statements inside body of loop execute.

At first iteration:

integer = input.nextInt(); statement reads the value of input integer. The first integer is 1

if (integer % 2 == 0) checks if integer is completely divisible by 2. The modulo operator is used which returns the remainder of the division and if this remainder is equal to 0 then it means that the integer is completely divisible by 2 and if the integer is completely divisible by 2 then this means the integer is even. 1%2 returns 1 so this means this condition evaluates to false and the integer is not even. So the else part executes:

odd += integer;   this becomes:

odd = odd + integer

odd = 1

Now the value of i is incremented to 1 so i=1

At second iteration:

integer = input.nextInt(); statement reads the value of input integer. The first integer is 2

if (integer % 2 == 0) checks if integer is completely divisible by 2. 2%2 returns 0 so this means this condition evaluates to true and the integer is even. So

even += integer;   this becomes:

even= even+ integer

even = 2

Now the value of i is incremented to 1 so i=2

At third iteration:

integer = input.nextInt(); statement reads the value of input integer. The first integer is 3

if (integer % 2 == 0) checks if integer is completely divisible by 2. 3%2 returns 1 so this means this condition evaluates to false and the integer is odd. So

odd += integer;   this becomes:

odd= odd + integer

odd= 1 + 3

odd = 4

Now the value of i is incremented to 1 so i=3

At fourth iteration:

integer = input.nextInt(); statement reads the value of input integer. The first integer is 4

if (integer % 2 == 0) checks if integer is completely divisible by 2. 4%2 returns 0 so this means this condition evaluates to true and the integer is even. So

even+= integer;   this becomes:

even = even + integer

even = 2 + 4

even = 6

Now the value of i is incremented to 1 so i=4

At fifth iteration:

integer = input.nextInt(); statement reads the value of input integer. The first integer is 5

if (integer % 2 == 0) checks if integer is completely divisible by 2. 5%2 returns 1 so this means this condition evaluates to false and the integer is odd. So

odd+= integer;   this becomes:

odd= odd+ integer

odd= 4 + 5

odd = 9

Now the value of i is incremented to 1 so i=5

When i=5 then i<num condition evaluate to false so the loop breaks. The next two print statement prints the values of even and odd. So

even = 6

odd = 9

Hence the output is:

Sum of Even Numbers: 6                                                                                                           Sum of Odd Numbers: 9  

6 0
3 years ago
hona is buying a rug for her room. Store A has the rug for $45 with a 10% discount. Store B has the same rug for $46 and is offe
Fed [463]
Store b. This will have her paying 36.00 for the rug. Store A she will pay 40.50
7 0
3 years ago
If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
kondor19780726 [428]
I believe the answer would be Draft Quality. (300x300 resolution).

5 0
3 years ago
Other questions:
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • Please help with this
    5·2 answers
  • A typical serial cable has
    13·1 answer
  • An excel user should use a relative cell reference when it is important to ____. preserve the relationship to the formula locati
    7·1 answer
  • Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Lette
    14·1 answer
  • Order the steps to take when drawing electron dot diagrams.
    15·2 answers
  • Oiê gentee, bom dia O que você entende por cultura digital ??
    12·1 answer
  • What is the effect of persistence of game worlds in social video games?
    14·2 answers
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • There are several design goals in building an operating system; for example, resource utilization, timeliness, robustness and so
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!