1 - 5 caculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

1 - 5 caculator

how do I make a bool value that looks for certain readlines like 2+3= 5 but how do I look for the 2+3 do I use "if"

11th May 2017, 11:57 AM
Exterior Alpha
8 Answers
+ 4
if you are taking a input as string then. string inp = console.readline(); if(inp.contains("2+3")){ //your code }
11th May 2017, 12:05 PM
MR Programmer
MR Programmer - avatar
+ 1
use capital c Contains
11th May 2017, 12:23 PM
MR Programmer
MR Programmer - avatar
+ 1
can you share your piece of code
11th May 2017, 1:02 PM
MR Programmer
MR Programmer - avatar
0
it told me that in contains no definition what did I do wrong
11th May 2017, 12:19 PM
Exterior Alpha
0
oh ok
11th May 2017, 12:23 PM
Exterior Alpha
0
when I type it in it comes out with no input
11th May 2017, 1:01 PM
Exterior Alpha
0
string inp = Console.ReadLine(); if(inp.Contains("1+1")){ Console.WriteLine ("2");
11th May 2017, 1:03 PM
Exterior Alpha
0
I fixed it it was missing 3 }
11th May 2017, 1:19 PM
Exterior Alpha