SHARE
TWEET

Untitled

a guest Nov 19th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. public class qshev
  4. {
  5.     public static void Main()
  6.     {
  7.         Console.WriteLine("interval za chisloto x1=");
  8.         float x1 = float.Parse(Console.ReadLine());
  9.         Console.WriteLine("interval za chisloto x2=");
  10.         float x2 = float.Parse(Console.ReadLine());
  11.         Console.WriteLine("Vhoden string: ");
  12.         string input = Console.ReadLine();
  13.  
  14.         CheckIfNum(input,x1,x2);
  15.     }
  16.  
  17.     static void CheckIfNum(string input,float x1, float x2)
  18.     {
  19.         float f;
  20.         if (float.TryParse(input, out f))
  21.         {
  22.             if (float.Parse(input) >= x1 && float.Parse(input) <= x2)
  23.             {
  24.                 Console.WriteLine("V intervala e");
  25.             }
  26.             else
  27.             {
  28.                 Console.WriteLine("Ne e v intervala");
  29.             }
  30.  
  31.         }
  32.         else
  33.         {
  34.             Console.WriteLine("NE MOJE, NE E CHISLO!");
  35.         }
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top