In: Computer Science
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
So, the loop that print the number from 64 to 339. There is no language was specified in your question. So i will write the code in C Language..
We will use "for loop" here. first we see the syntax of the for loop.
for(intialisation ; condition ; increment)
first we wil declare a variable for the loop as
int i; // this means we will have a variable i that is of type integer.
for(i=64; i<=339; i++)
i++ : increment operator, which means i+1.
the whole program is
and the output is in Program in the line of printing the values of i :
printf("%d\t"i);
%d : is format specifier for integer,
\t : is used for giving the spaces between the values of i, as you see in the output screen.
KINDLY HIT LIKE!!!!!
As you ask for java code in comment so here it is
I have declare class Loop23, but you can choose your own name of class.
Look there is no diffrence in the Syntax in Loop in java and C in for and while loop. but the printing of the value was done diffrently.
KINDLY HIT LIKE!!!