1. Show the output of this program. Use a window with grid on the next page for the
graphics output
#include "IOTools.h"
#include "Graphics.h"
void Numbers(){
int M, N;
M = 5; N = 7;
cout << M << " : " << N << endl;
N = N - M;
M = 2 * M + N;
cout << M << " : " << N << endl;
M = 5; N = 7;
int S = N / M * M + N;
int T = N * M % N;
cout << S << " : " << T << endl;
cout << endl;
}
void Looping(){
int K;
for (K = 0; K < 6; K++){
cout << K << " * " << K << " = " << K * K << endl;
}
cout << endl;
for (K = 1; K <10; K += 2){
cout << K << " % 5 = " << K % 5 << endl;
}
}
void Abstract(){
for (int x = 20; x < 200; x += 50)
FrameCircle(x, 150, 20);
int size = 20;
for (int x = 10; x < 200; x += size){
DrawLine(0, 0, x, 100);
size += 20;
}
}
int main(int argc, char* argv[]) {
GraphicsWindow GW0(200, 200); // Build graphics window
ConsolePlaceBelow(0); // Move console below graphics window
MakeConsoleForeground(); // Give the console the focus
Numbers();
Abstract();
Looping();
PressReturn("\nThe main program is about to terminate\n");
return 0;
}

Last Updated: November 27, 1999 7:16 pm by