Program of nested loop - c# program, DOT NET Programming

Program of Nested Loop - C# Program

I am a learner of C# language and i am struggling with the Loops in c#. Can you have any code examples for this.

Posted Date: 2/11/2013 8:08:05 AM | Location : United States





Try this code:

using System;  

class MarksRange

{

public static void Main()

{    int i, count80 = 0, count60 = 0, count40 = 0, count0 = 0;

float [] marks = {57.5F, 45.9F, 98.01F, 56.4F, 46.5F, 80, 82, 67,76,49, 91,55, 78,79, 19.5F, 25.8F, 35, 36,35,28,25.8F,46,55,59,68,97,85,48.5F,67,84};    

   for (i = 0; i<=29; i++)    

  {

    If (marks[i] > 80 && marks [i] < 101)

   {

    count80 = count80 + 1;

   }

    else if(marks [i] > 60 && marks[i] < 81)

   {

    count60 = count60 + 1;

   }

    else if(marks [i] > 40 && marks[i] < 61)

   {

    count40 = count40 + 1;

   }

    else

   {

    count0 = count0 + 1;

   }

  }  

  Console.WriteLine("Students in the range of 81 - 100 : "+ count80);

  Console.WriteLine("Students in the range of 61 - 80  : "+ count60);

  Console.WriteLine("Students in the range of 41 - 60  : "+ count40);

  Console.WriteLine("Students in the range of 0 - 40   : "+ count0);  

  Console.ReadLine();  

 }

}

Posted by Archie | Posted Date: 2/11/2013 8:10:27 AM


Related Discussions:- Program of nested loop - c# program, Assignment Help, Ask Question on Program of nested loop - c# program, Get Answer, Expert's Help, Program of nested loop - c# program Discussions

Write discussion on Program of nested loop - c# program
Your posts are moderated
Related Questions
TFS - SpiraTeam synchronization plugin. Project Description: We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was de

State the differences between the Dispose () and Finalize(). CLR uses the Dispose and Finalize methods to perform garbage collection of run-time objects of .NET applications.

I need Online Real Commission Management system Project Description: Real Estate -- Store and retrieve Purchase plot customers, Employee to refer the customers get commiss

Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

Project Description: I require a flight scheduling website, including billing and basic aircraft management; this will be used by a local piloting school There is no requirin

What is the Append Format for FileUpload Control in ASP.Net? What it specify?

I am seeking someone (person or company) who already has been developing some ASP.NET MVC 4 application with the subsequent requirements (so there is no need to spend extra time to

How can we implement singleton pattern in .NET ? The Singleton pattern basically focuses on having one and only one instance of the object running. Lets take an e.g. a windows

Prepare a script to automate the software "muvee Reveal" Project Description: My name is Mark, I run a company engaged in E-Learning products. We looked for a long time fo

Virtual Webcam effects + Sourcecode + Setup + Nice User Interface Project Description: i want a similar webcam effects application which can apply effects to webcam feed. So