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
Work on different coding using visual studio 2012/2013 writing Java script as well as C# codes. Project Description: I want to shift to new Programming Env. and I would like

Print Triangle in Reverse Pattern - C# Program Need the code of C# Program for Print Triangle in Reverse Pattern.

How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method? To Call the Dispose method in the Finalize method and in the Dispose

Project Description: It is online portal for hotel n packages sales. The project requires to be built on sql, Jquery and c#. The project should be submitted with all coding a

What are the features of ADO.Net ?  ADO.NET features: 1. Disconnected Data Architecture 2. Data cached in Datasets 3. Data transfer in XML format 4. Interaction wit

I need help in Calendar integration into site using .net I'm demanding to create a web-based proof of concept for the following scenario. I'd like to permit a user to select

Project Description: Simple task and requirements to be done professionally. Propose an Object Oriented design and show drawback. .NET, C Programming, Business Analysis, P

ASP Programmer I need a fixing all W3c validation errors and it is a ASP website. Have any queries please send a message and I will provide more information on project. De

What are the advantages of DLR? The various advantages provided by DLR are: Permits you to easily execute the dynamic languages to the .NET Framework. Gives dynamic featu

how do I load txt file into listbox