Condition such that “if i is more than double j result assign string1, else if i is more than j result assign string2, else result assign string3.
- using System;
- namespace HelloWorld
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i = 10; int j = 20;
- const string string1 = "Paper";
- const string string2 = "Scissors";
- const string string3 = "Rock";
- string result;
- if (i*2>j)
- {
- result = string1;
- }
- else if (i>j)
- {
- result = string2;
- }
- else
- {
- result = string3;
- }
- Console.WriteLine(result);
- }
- }
- }

Gowtham RamarRank #1,754 · 860 reputationPosted Nov 30, 2018, 10:26 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Nov 30, 2018, 10:19 PM EST