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
Problem: (a) Explain the difference between these two lines of ASP codes: (b) The VBScript language includes some built-in functions which are often used in ASP co

I need C# AAC sound receiver over WCF Project Description: I want a WCF method which is able to receive a byte stream of an AAC sound file from iPhone device and save it on t

This assignment will have you create a simple static web page. It should look something like this: The colored boxes do not represent colors I want to see, make it look nic

What is scavenging? When server running your ASP.NET application runs low on the memory resources, items are discarded from the cache depending on cache item priority. The Cach

Project Description: Specifically i need develop one web based application which have student registration and according to semester and each time it will change as per semester

Experienced Microsoft .NET web developer I have a various projects for which I need a web developer for. The developer will be the sole product owner hence should be dependab

Develop Outlook Add-In for all versions I need simple code for Outlook(express,2003,2007,2010,2013) Add-In with functionality to repeatedly send CC to the specified email(s), th

Project Description: We are seeking a simple tool that can convert an existing flash file (.SWF) into HTML5. Our idea is to convert small flash games into html5 games. Please NO

What is the use of the Connection object? The Connection object is used to connect your application to a specific data source by giving the needed authentication information in

Djvu view and setup,  sourcecode with nice UI Project Description: i want an application build for viewing djvu files -must include setup -must include source code -