Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.Write("enter a value a1:");
- int a1 = int.Parse(Console.ReadLine());
- if (a1 < 0)
- {
- a1 = a1 * (-1);
- int const1 = 100;
- int const2 = 10;
- double rezult1 = a1 / const1;
- double rezult2 = rezult1 % const2;
- Console.WriteLine(rezult2);
- if (rezult2 == 7)
- {
- Console.WriteLine("third digit is: 7");
- }
- else
- {
- if (rezult2 > 7)
- {
- Console.WriteLine("third digit is > 7");
- }
- else
- {
- Console.WriteLine("third digit is < 7");
- }
- }
- }
- else
- {
- if (a1 >= 0)
- {
- a1 = a1 * 1;
- int const1 = 100;
- int const2 = 10;
- double rezult1 = a1 / const1;
- double rezult2 = rezult1 % const2;
- Console.WriteLine(rezult2);
- if (rezult2 == 7)
- {
- Console.WriteLine("third digit is: 7");
- }
- else
- {
- if (rezult2 > 7)
- {
- Console.WriteLine("third digit is > 7");
- }
- else
- {
- Console.WriteLine("third digit is < 7");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement