C programming problen in understanding the code, anyone can help and comment

int main(void) {

int i, n;

printf("this program prints a table of square. \n");

printf("Enter number of entries in table: ");

scanf("%d", &n);

i = 1;

while (i <= n){

printf("%10d%10d\n", i, i*i);

i++;

}

return 0;

WHAT IS THE “%10D” DO HERE
AND THERE IS A “i” BETWEEN THE I+I, WHAT IT IS FOR;

im not familiar with C, but those seem like some simple parameter rules for strings used in the example functions(printf(), scanf()). It would be much more productive on your part, to go see lessons regarding those functions, what they do, what parameters they expect and how to read their parameters, what would % do within a string. Those are not that advanced matters. Its always nice to know the basics of a code

When in doubt, Google the function that you want to understand:
https://www.cplusplus.com/reference/cstdio/printf/

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.