Sunday, June 22, 2014

C# Tutorial for Beginners 5 - If-Statement with Comparison Operators and...









1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
namespace MyProject.Examples
{
    class ExampleOne
    {
        static void Main()
        {
            int num1, num2;            
            //Accepting Values from users
            Console.Write("Enter first number\t\t");
            num1 = Convert.ToInt32(Console.ReadLine());

            Console.Write("\n\nEnter second number\t\t");
            num2 = Convert.ToInt32(Console.ReadLine());

            if(num1<num2 || num1==20)
            {
                Console.Write("num1 is less then num2 or num 1 is 20\t\t");
            }
            else if (num1 == num2)
            {
                Console.Write("num1 is = num2\t\t");
            }
            else
            {
                Console.Write("num1 is gererat then num2\t\t");
            }
  
            Console.ReadKey();
        }
    }
}


















-----------------------------------------------

Searches related to c# if statement

c# if statement shorthand

c# if statement multiple conditions

c# if statement string

c# if statement one line

c# if statement or operator

c# if statement not equal

nested if statement c#

c# assignment in if statement

Searches related to c# Comparison Operators

c# comparison operators enum

relational operators

equality comparison

operators equality

c# logical operator

c# string comparison operators

c# override comparison operator

Searches related to c# Logical Operator

c# logical operator precedence

c# logical operator short circuit

c# boolean operators

c# logical xor operator

.net & operator

c# not operator

visual c# operators

c# short circuit

c# logical operators precedence
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ