#include <stdio.h>

int main() {
    // declare two integers.
    int a = 10, b = 20;

    // declare two pointers pointing to 'a' and 'b'.
    int *p = &a, *q = &b;

    // working with relational operators and pointers.
    if (p == q) {
        printf("p is equal to q\n");
    } else if (p > q) {
        printf("p is greater than q\n");
    } else {
        printf("p is less than q");
    }

    // print the addresses.
    printf("\n");
    printf("the address stored in p is %zu\n", p);
    printf("the address stored in q is %zu\n", q);

    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: