Suppose that I have to print the following lines:
Number 1 is 5 Number 2 is 6 Number 3 is 7 Number 4 is 8 Number 5 is 9
Now, if I were programming in C, I would have run the following code :
for(i=1;i<=5;i++)
{printf("Number %d is %d \n",i,i+4);}
Print["Number %d is %d", i, i + 4] doesn't work in Mathematica (and yes, I am aware of it).
Moreover, in $C$, I can scan input like this:
for(i=0;i<5;i++)
{printf("Enter Number %d: ",i);
scanf("%d",&Scanned[i])}; \* Where Scanned[i] is the Array Storing Values of the Numbers *\
I tried
For[i = 0, i < 5, i++, Scanned[i] = Input["Enter the Number %d: ", i]]
But it didn't work (I guess %d is not recognizable by Mathematica).
So how would I implements these tasks in Mathematica?
(I apologize if this question is of very low level, but I searched a lot for it, and didn't get an appropriate answer to my query.)



StringTemplateorStringFormto learn about templates syntac in Mathematica. The way to go isDo + Print + StringTemplate. You may also be interested in column. – Kuba Jun 17 '17 at 16:38