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
egoroff_w [7]
3 years ago
12

write a program in C# that reads a set of integers and then finds and prints the sum of the even and odd integers?​

Computers and Technology
1 answer:
trapecia [35]3 years ago
5 0

Answer:

The program in C# is as follows:

using System;

class Prog {

 static void Main() {

   int n;

   Console.WriteLine("Number of integers: ");

   n = Convert.ToInt32(Console.ReadLine());

   int evensum = 0, oddsum = 0; int inpt;

   for(int i = 0;i<n;i++){

       inpt = Convert.ToInt32(Console.ReadLine());

       if(inpt%2==0){            evensum+=inpt;        }

       else{            oddsum+=inpt;        }

   }

    Console.WriteLine(evensum);

    Console.WriteLine(oddsum);

 }

}

Explanation:

This declares n, the number of integer inputs

   int n;

This prompts for n

   Console.WriteLine("Number of integers: ");

This gets input for n

   n = Convert.ToInt32(Console.ReadLine());

This declares and initializes the even and odd sum.

   int evensum = 0, oddsum = 0; int inpt;

This iterates through n

   for(int i = 0;i<n;i++){

This gets each input

       inpt = Convert.ToInt32(Console.ReadLine());

Check for even numbers and add,if even

<em>        if(inpt%2==0){            evensum+=inpt;        }</em>

Otherwise, add input as odd

<em>        else{            oddsum+=inpt;        }</em>

   }

Print even sum

    Console.WriteLine(evensum);

Print odd sum

    Console.WriteLine(oddsum);

 }

You might be interested in
Computer-aided design software can _________________ a. See details that could not be visible with drafting or modeling. B. Simu
kvasek [131]

Answer:

Your answer would be option D

Explanation:

Computer aided software can do everything that it states from A to D.

A, is true because it could display physics of items such as building models or cars.

B, This is very common such as WW11 movies and there backgrounds, such as a city that doesn't exist anymore or the world trade center before the incident.

C, With current tech you would make many different landscapes and areas that don't even exist like editing a grassy landscape during fall and putting snow over the land scape making it look like there is snow when there's not.

BRAINLEIST PLEASE! if you have any questions please ask.

6 0
3 years ago
Using web-safe fonts and colors is something you can do to increase blank
Lostsunrise [7]

Using web-safe fonts and colors is something you can do to increase user experience and reliability when creating a web app by ensuring compatibility.

<h3>What are web-safe fonts and colors?</h3>
  • Fonts and colors are considered web-safe when they are included in the basic installation of web browsers.
  • What this means is that these fonts and colors come preinstalled in browsers.
  • This ensured compatibility leads to increased reliability.
  • Having a reliable web app improves user experience and makes for a more successful application.

Therefore, given that web-safe fonts and colors are just those that come preinstalled in most web browsers, using these during the development of your web app will ensure that most users will not have any issues. This increases reliability and improves the user experience.

To learn more about web fonts visit:

brainly.com/question/14450275?referrer=searchResults

7 0
3 years ago
Difference between desktop, web and mobile apps
Lyrx [107]

there are many differences, but the most prominent are that they have different apis (aplication programing interface) and different architecture

also mobile apps tend to use less system resources and are more regulated by services like the google play store, opposed to the fairly unregulated uwp platform used by most windows machines.  


4 0
4 years ago
What is the shortcut key to apply /remove the subscript effect?<br> Ctrl+=<br><br> Ctrl-+
telo118 [61]

Answer:

Press "Ctrl, "Shift" and "=" on your keyboard to turn off superscript formatting.

5 0
3 years ago
__________ is the order of arrangement of files and folders.
lesya692 [45]

sequence is the order of arrangement of files and folders.

6 0
3 years ago
Other questions:
  • Angela recently purchased a new Android smartphone. While purchasing the phone, Angela was told that she would need to set up a
    5·1 answer
  • What is the working principle of computer?
    9·1 answer
  • Which of the following is not a compilation error? Group of answer choices a. Placing a semicolon at the end of the first line o
    13·1 answer
  • How can I change my username here at brainly?
    13·2 answers
  • PlayStation or Xbox HELP i need to know
    13·1 answer
  • Create an array class consisting of a static array of three elements, and describe it in such a way that the Point and Vector cl
    8·1 answer
  • What is the next line?
    7·1 answer
  • True or false = the order of cannot be changed in slide shorter view ,true or false =menu bar is located just below the title ba
    8·2 answers
  • Choose all of the items that represent parts of an operating system.
    6·2 answers
  • How to run angular project from github.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!