~nhanb/modernc

52e33b88588f3986506e5a6ef0528195023531b3 — Nhân 1 year, 3 months ago 63fd0f7
bad.c
3 files changed, 24 insertions(+), 3 deletions(-)

M .gitignore
M Makefile
A bad.c
M .gitignore => .gitignore +1 -1
@@ 1,1 1,1 @@
/getting-started
/out

M Makefile => Makefile +5 -2
@@ 1,2 1,5 @@
getting-started: getting-started.c
	c99 -Wall -o getting-started getting-started.c -lm
out/bad: bad.c
	c99 -Wall -o out/bad bad.c

out/getting-started: getting-started.c
	c99 -Wall -o out/getting-started getting-started.c -lm

A bad.c => bad.c +18 -0
@@ 0,0 1,18 @@
#include <stdio.h>
#include <stdlib.h>

void main() {
  int i;
  double A[5] = {
      9.0,
      2.9,
      3.E+25,
      .00007,
  };

  for (i = 0; i < 5; ++i) {
    printf("element %d is %g, \tits square is %g\n", i, A[i], A[i] * A[i]);
  }

  return 0;
}