76 339
Assignments Done
Successfully Done
In May 2019

Answer to Question #23640 in C# for Sh

Question #23640
Write a C# program to count the number of negative numbers in a sequence of numbers the user inputs. In this solution, before reading the numbers, ask the user to input how many numbers will be input.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Egative_numbers_in_a_sequence
class Program
static void Main(string[] args)
int number=0;
int countofnegetivenumbers = 0;
int inputnumber;
Console.Write("How many numbers will be input ");
number = int.Parse(Console.ReadLine());
for (int i = 0; i < number; i++) {
Console.Write("Enter number: ");
inputnumber = int.Parse(Console.ReadLine());
if (inputnumber < 0) {
Console.Write("The number of negative numbers in a sequence are: " +


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions