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
Project Description: I have a website that I have prepared, but I would like someone to make it look nicer. Most of the functionality is there, but I need help with design which

Produce a server setup where I have access to ip address Project Description: I would require using ftp or remote desktop to put software on your server (must be a united sta

What is CTS and CLS? => CLS stands for common language specification where as CTS stands for common type system. => CLS : cls is a standard for .net . cls is small set of sp

When we create a private constructor, we can not create object of the class directly from the client. So you will use the private constructors whenever you do not want instances of

Asp .net Facebook app project completion Project Description: We are a small development house in Singapore, and have a project which is 90 percent complete; thus our previou

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

How can we use .NET components in COM .NET components can't be used in straight forward way with the COM. You will require to create CCW in order to communicate COM components

Project Description: The website should be CMS based; coding done only on ASP, MySql databases, .net script, aspx and java use with least of the flash work. We will be sharing j

What is a Cloud Service? A cloud service is used to build cloud applications. This service gives the facility of using the cloud application without installing it on the comput

Project Description: I'm presently seeking at least one more coder that will help me out manage all my concepts and in that way we will share each other's experience and make te