Онлайн компилятор C

#include <stdio.h> int main() { int n; if (scanf("%d", &n) == 1) { for (int i = 1; i <= n; i++) { printf("%d %d %d\n", i, i * i, i * i * i); } } return 0; }
This code reads an integer `n` from the user, then prints a table of numbers from 1 to `n` along with their squares and cubes. Each line shows the number, its square, and its cube.

- The loop variable `i` starts at 1 and goes up to `n`, so the output includes the first `n` positive integers.
- The `scanf` check ensures the program only runs if an integer is successfully read.