text: Count of integral coordinates that lies inside a Square | C ++ program for the above approach ; Function to calculate the integral points inside a square ; Driver Code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; void countIntgralPoints ( int x1 , int y1 , int x2 , int y2 ) { cout << ( y2 - y1 - 1 ) * ( x2 - x1 - 1 ) ; } int main ( ) { int x1 = 1 , y1 = 1 ; int x2 = 4 , y2 = 4 ; countIntgralPoints ( x1 , y1 , x2 , y2 ) ; return 0 ; }