TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anti virus
NA
17
3.5k
help with a foreach loop condition
Dec 15 2018 11:49 AM
calculate the sum of the values in the marks array.
Calculate the mean average value and assign that to the average variable.
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int sum = 0;
int[] marks = { 24, 10, 26, 20 };
foreach (int mark in marks)
{
int sum1 = marks.Sum();
}
Console.WriteLine(sum);
}
}
}
Reply
Answers (
1
)
arrays and using a for loop function
loop that identify values