s12_while_to_for.cpp
4 years ago in C
#include <stdio.h>
main() {
// --- ÖNCESİ ---
int x = 1;
int y;
while (x <= 10)
{
y = x * x;
printf("%d %d\n", x, y);
x += 3;
}
*/
// --- SONRASI ---
int y;
for (int x=1; x <= 10; x+=3)
{
y = x * x;
printf("%d %d\n", x, y);
}
}