TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
13
2.6k
condditional statements help?
Dec 1 2018 3:12 AM
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);
}
}
}
Reply
Answers (
2
)
How to run this code for .net busy
Logical and relational expressions