62 556
Assignments Done
98,8%
Successfully Done
In June 2018

Answer to Question #21699 in C# for tofik mohamed

Question #21699
write a program that reads three integers from the keyboard and outputs their sum and product
Expert's answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Question21699
{
class Program
{
static void Main(string[] args)
{
double[] arrayofnumbers=new double[3];
double sum=0;
double product = 1;
for(int i=0;i<3;i++){
Console.Write("Enter number {0}: ", (i+1));
arrayofnumbers[i] = int.Parse(Console.ReadLine());
}
for (int i = 0; i < 3; i++) {
sum += arrayofnumbers[i];
product *= arrayofnumbers[i];
}
Console.Write("Sum = {0}", sum);
Console.Write("
Product = {0}", product);
Console.ReadLine();
}
}
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions