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
Readymade NopCom 3.2 receptive website needs modifications. This is a developer/ webdesign (nopcommerce) opportunity which can allow a good developer/ designer the ability to creat

WFP and windows hook drivers expert required Project Description: I want a class which will have a function to block a particular url. I want this to be done using Windows

13579 3579 579 79 9 How to the logic in code. pls give me Ans.

SOAP Web Services A SOAP Web Service that supports three operations: add a bibliography entry, delete a bibliography entry and list all bibliography entries. You may design fo

Project Description: I require a C# Console project written to simply enter an Origin and Destination/Date on the United Airlines Site, from the returned page select and return

Create a Calculator application using Web Form with the following functions: 1.  Add 2.  Minus 3.  Multiply 4.  Divide Each of the above has to be a Web Service

ASP.NET/MSSQL/ MVC completing backend solution + integrating with frontend. - repost Project Description: System is used for tracking company's activities through several pro

Which namespaces are required to enable the use of databases in ASP.NET pages? The following namespaces are required to enable the use of databases in ASP.NET pages:     Th

Modification in .net website I need some modification in asp.net website. It's an e-commerce site. Skills required: .NET, HTML, eCommerce, Shopping Carts, Website Design

What are resource files? The Resource files are the files which contain program resources. Many programmers think that resource files are used only for storing strings. But you