import java.io.*;
import java.util.*;
class GFG {
static void checkTriangle(int x1, int y1,
int x2, int y2,
int x3, int y3)
{
int a = x1 * (y2 - y3) +
x2 * (y3 - y1) +
x3 * (y1 - y2);
if (a == 0)
System.out.println("No");
else
System.out.println("Yes");
} in C++ Standard Template Library (STL)
Modulo Operator (%) in C/C++ with Examples
5th Floor, A-118,
Sector-136, Noida, Uttar Pradesh - 201305
feedback@geeksforgeeks.org
Company
About Us
Careers
Privacy Policy
Contact Us
Copyright Policy
Learn
Algorithms
Data Structures
Languages
CS Subjects
Video Tutorials
Web Development
Web Tutorials
HTML
CSS
JavaScript
Bootstrap
Contribute
Write an Article
Write Interview Experience
Internships
Videos
@geeksforgeeks , Some rights reserved
Lightbox
Start Your Coding Journey Now!
×
Search Term:“
”
1
2
3
import java.io.*;
4
import java.util.*;
5
6
class GFG {
7
8
9
10
static void checkTriangle(int x1, int y1,
11
int x2, int y2,
12
int x3, int y3)
13
{
14
15
16
17
18
19
20
int a = x1 * (y2 - y3) +
21
x2 * (y3 - y1) +
22
x3 * (y1 - y2);
23
24
25
26
if (a == 0)
27
System.out.println("No");
28
else
29
System.out.println("Yes");
30
}
31
32
33
public static void main(String[] args)
34
{
35
int x1 = 1, y1 = 1,
36
x2 = 2, y2 = 2,
37
x3 = 3, y3 = 3;
38
checkTriangle(x1, y1, x2, y2, x3, y3);
public static void main(String[] args)
{
int x1 = 1, y1 = 1,
x2 = 2, y2 = 2,
x3 = 3, y3 = 3;
checkTriangle(x1, y1, x2, y2, x3, y3);
}
}