VB icon

If Else Statement in C#

Email
Submitted on: 6/19/2016 3:09:23 AM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: C#
Views: 2155
author picture
 
     This sample program written in C# will show you how to use if else statement this sample program is being provided by my good friend and fellow programmer Mr. Dave Marcellana. Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: If Else Statement in C#
// Description:This sample program written in C# will show you how to use if else statement this sample program is being provided by my good friend and fellow programmer Mr. Dave Marcellana.
 Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
// By: Jake R. Pomperada
//**************************************

if-else.cs
using System;
public class if-else
{
public static void Main()
{
int n;
for(n=0; n<21; n++)
{
if(n == 0)
{
Console.WriteLine("First one: " + n);
}
else if(n < 5)
{
Console.WriteLine("Less than five: " + n);
}
else if(n == 10 || n == 11)
{
Console.WriteLine("Ten or Eleven: " + n);
}
else if(n >= 13 && n <= 18)
{
Console.WriteLine("YEHEY!!");
}
else
{
Console.WriteLine("Not less than five: " + n);
}
}
}
}


Other 41 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.