Answer to Question #10882 in C# for YADAV ANKIT

Question #10882
write a program to calculate a sum of all the nos getting an input through command line argument
1
Expert's answer
2012-06-15T12:00:07-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
try
{
float sum = 0;
for (; ; )
{
Console.Write("Enter number: ");
sum += float.Parse(Console.ReadLine());
Console.WriteLine("The sum is " + sum.ToString());
}
}
catch (Exception exp) {

}

}
}
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS