When we look at CYCLES programming in C, it is important to know how to use their structure to achieve what we want.
The wording of the exercise would the following:
Print a list of numbers from 1 to 100 each with its own square.
You know, working with loops can achieve the same result using different structures FOR, WHILE or DO WHILE + , one would have to be careful when writing the algorithm and various instructions to be used.
# include \u0026lt;iostream.h>Personally I prefer to work using the command CYCLES FOR , but it's good to think about doing the same exercises through different directions and structures.
int a, b, c;
int main (void ) {
for (a = 1, at \u0026lt;= 100 , a + +) {
c = a * a;
court \u0026lt;\u0026lt; a \u0026lt;\u0026lt;"and its square is" \u0026lt;\u0026lt;c \u0026lt;\u0026lt;endl;}
system ("pause");
return 0;}
0 comments:
Post a Comment