Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class qshev
- {
- public static void Main()
- {
- Console.WriteLine("interval za chisloto x1=");
- float x1 = float.Parse(Console.ReadLine());
- Console.WriteLine("interval za chisloto x2=");
- float x2 = float.Parse(Console.ReadLine());
- Console.WriteLine("Vhoden string: ");
- string input = Console.ReadLine();
- CheckIfNum(input,x1,x2);
- }
- static void CheckIfNum(string input,float x1, float x2)
- {
- float f;
- if (float.TryParse(input, out f))
- {
- if (float.Parse(input) >= x1 && float.Parse(input) <= x2)
- {
- Console.WriteLine("V intervala e");
- }
- else
- {
- Console.WriteLine("Ne e v intervala");
- }
- }
- else
- {
- Console.WriteLine("NE MOJE, NE E CHISLO!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement