Posts

Showing posts from November, 2018

CS_0006_Condition3

Result: Please enter your choice 1 or 2 or 3 2 You have entered  2, so you won  BIKE using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Condition3 {     class Program     {         static void Main( string [] args)         {             Console .WriteLine( "Please enter your choice 1 or 2 or 3" );             string userValue = Console .ReadLine();             string message = (userValue == "1" ) ? "CAR" : "BIKE" ;             Console .WriteLine( "You have entered   {0}, so you won   {1}" , userValue, message);  ...

CS_0005_Condition2

Result: Checking True or False Condition: Please enter your choice 1 or 2 or 3 2 You won:BIKE using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace trueOrFalse {     class Program     {         static void Main( string [] args)         {             Console .WriteLine( "Checking True or False Condition:" );             Console .WriteLine( "Please enter your choice 1 or 2 or 3" );             string userValue = Console .ReadLine();             string message = (userValue == "1" )? "CAR" : "BIKE" ;        ...

CS_0004_Condition1

Result: Lucky Draw Contest! Please enter your choice 1 or 2 or 3 3  you won the Bike1 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ifElseIfElse {     class Program     {         static void Main( string [] args)         {             Console .WriteLine( "Lucky Draw Contest!" );             Console .WriteLine( "Please enter your choice 1 or 2 or 3" );             string userValue = Console .ReadLine();             string message;             if (userValue == "1" ) ...

CS_0003_String1

Result: Hello,please enter your name: Please enter your first name:mathi Please enter your last name:krishnan   Nice  to meet you!  mathi  krishnan using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace string1 {     class Program     {         static void Main( string [] args)         {             Console .WriteLine( "Hello,please enter your name:" );             Console .Write( "Please enter your first name:" );             string myFirstName = Console .ReadLine();             Console .Write( "Please enter your last name...

CS_0002_Variable1

Result ; x = 3 y = 7 The value of z = x+y that is:10 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace variables1 {     class Program     {         static void Main( string [] args)         {             int x;             x = 3;             int y;             y = 7;             int z;             z = x + y;             Console .WriteLine( "The value of z = x+y that is:" +...

CS_0001_HelloWorld

using System; using System . Collections . Generic; using System . Linq; using System . Text; using System . Threading . Tasks; namespace HelloWorld {     class Program     {         static void Main( string [] args)         {             Console . WriteLine( "Hello World!" );             Console . ReadLine();         }     } }