Gwin is the graphics window we have to use, pretty simple most of the commands are self explanitory.
Anyway i got the error in the topic and cant work out why its throwing me and error about the closing brace of the program. Help appreciated cheers
CODE
#include "stdafx.h"
#include "gwin.h"
#include <string>
#include <iostream>
#include <time.h>
#include <sstream>
using namespace std;
int main()
{
bool flag=true;
int ans=1;
do
{
int Number; //to be entered by user
int ReversedNumber=0; //initialise to zero since should start with nothing
int LastDigit; // taken off each time
// Clear the Gwin window
Gwin.clear();
//Prompt user for number to be reversed
Gwin.writeText(0,0, "Enter positive integer to be reversed: ");
Number = Gwin.getInt();
while (Number>0)
{
LastDigit = Number%10; //will be between 0 and 9
ReversedNumber = ReversedNumber*10 + LastDigit;
Number = Number/10; //integer divide, so will lose last digit eg goes from 1234 to 123
// Output the reversed number
Gwin.writeText(0, 20, "The reversed number is : ");
Gwin.writeInt(200, 20, ReversedNumber);
Gwin.writeText(0, 50, "Press 0 to end any number to reverse another number: ");
flag=Gwin.getInt();
if(flag==false)
{break;
}
}
// Finally, wait for a key to be pressed
Keyboard.getch();
return 0;
}
}