midtermF98sol

midtermF98sol - Code #include #include main()...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Code #include "stdio.h" #include "math.h" main() { int x,y,z; FILE *fp; fp = fopen("output.dat","w"); for (x = 1; x < 4; x++) fprintf(fp,"X = %d, ",x); fprintf(fp,"\n"); for (x = 5; x <= 25; x = x + 5) fprintf(fp,"X = %d, ",x); fprintf(fp,"\n"); for (x = 10; x >0; x--) fprintf(fp,"X = %d, ",x); fprintf(fp,"\n"); for (x = 0,y = 0; x < 3; y++,x++) fprintf(fp,"X = %d, ",x+y); fprintf(fp,"\n"); for (x = 0,y = 10; x < 3 & y > 6; y--,x++) fprintf(fp,"X = %d, ",x+y); fprintf(fp,"\n"); for (x = 1; x < 3; x++) for (y = 1; y < 3; y++) fprintf(fp,"X = %d,Y = %d, ",x,y); fprintf(fp,"\n"); for (x = 1; x < 3; x++) for (y = 1; y < 3; y++)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fprintf(fp,"\n"); for (x = 1; x < 8; x++) fprintf(fp,"X = %d, ",x++); fprintf(fp,"\n"); x = 36; if (x == 37) fprintf(fp,"Yes"); else fprintf(fp,"No"); fprintf(fp,"\n"); x = 36; y = 45; fprintf(fp,"Yes"); else fprintf(fp,"No"); fprintf(fp,"\n"); x = 37; y = 45; if (x == 37 || y == 42) fprintf(fp,"Yes"); else fprintf(fp,"No");
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

midtermF98sol - Code #include #include main()...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online