fork(2) download
  1. // 演習問題 0.0
  2.  
  3. #include <stdio.h>
  4.  
  5. int main(void) {
  6. int i=0;
  7. for (i=0;i<10;i++) {
  8. int j = i * 2; // j は for ループの内側でしか使っていないので、ここで宣言して初期化する。
  9. printf("%d %d\n",i,j);
  10. }
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
0 0
1 2
2 4
3 6
4 8
5 10
6 12
7 14
8 16
9 18