0
where did i go wrong ?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int age = Convert.ToInt32(Console.ReadLine());; if ( age >= 18) { Console.WriteLine("Too young"); } else if( age >= 30) { Console.WriteLine("You still poor"); } else if( age >= 50) { Console.WriteLine(" You ve got the money now "); } } } } https://code.sololearn.com/cv7cL117F5jO/?ref=app //output is always too young
5 Answers
0
corrected i think
https://code.sololearn.com/cv7cL117F5jO/?ref=app
+ 11
Give priority to posting a link to the code rather than posting the whole question here.
It will help us debug your program
+ 5
Hey what do you expect the output?
Suppose I enter age 70 it is >18 so only first if will get executed ...Everytime ..Your logic in this code is flawed..
+ 1
i've posted the link
+ 1
Interesting. If the order of logic results is reverse, 50 and its result first, does this fix the problem?