Pointer Comparison

Medium Pointers
Solve in Playground →

Problem Statement

Write a C program to compare two pointers pointing to different array elements and determine which comes later.

Input Format

Two integers representing indices I and J within an array of size 5.

Output Format

Print 'Greater' if pointer at J is after I, 'Equal' if same, or 'Smaller'.

Constraints

0 <= I, J < 5

Sample Input

1 3

Sample Output

Greater

Explanation

Index 3 is located after index 1 in memory.

Starter Code

#include <stdio.h>

int main() {
    int i, j;
    if (scanf("%d %d", &i, &j) == 2) {
        int arr[5] = {10, 20, 30, 40, 50};
        // Write your code here
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used