Write a program using LINQ to find the sum of first 5 prime numbers?
Submitted by: Administratorclass Program
{
static void Main()
{
int[] MyPrimeNumbers = {1,2,3,5,7};
// Use the Count() and Sum() Standard Query Operators to
// compute the count and total sum respectively
Concole.WriteLine("The sum of first {0} prime number is {1}",
MyPrimeNumbers.Count(), MyPrimeNumbers.Sum());
}
}
Submitted by: Administrator
{
static void Main()
{
int[] MyPrimeNumbers = {1,2,3,5,7};
// Use the Count() and Sum() Standard Query Operators to
// compute the count and total sum respectively
Concole.WriteLine("The sum of first {0} prime number is {1}",
MyPrimeNumbers.Count(), MyPrimeNumbers.Sum());
}
}
Submitted by: Administrator
Read Online LINQ Job Interview Questions And Answers
Top LINQ Questions
☺ | What is LINQ? |
☺ | What is a Lambda expression? |
☺ | What is the extension of the file, when LINQ to SQL is used? |
☺ | What is the LINQ file extension that interacts with Code Behind objects. |
☺ | How LINQ is beneficial than Stored Procedures? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | WPF Interview Questions. |