473,516 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i make a c++ program when it finishes go back to start

1 New Member
i want my program that when it ends instead of closing it goes back to the top
like an example:

main()
{
int go;
cout<<"text here ";
cin>>go;

if(go==10)
{
cout<<"wow u made it";
}
getch();
}



instead of closing the program when u press enter, i want it to go back to start
can someone help me?
Aug 8 '07 #1
1 7113
RRick
463 Recognized Expert Contributor
The concept you are taking about is looping. Loops allow specific code to be rerun as many times as you want.

The following link has an example of this control structure.

http://www.cplusplus.com/doc/tutorial/control.html
Aug 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

30
74840
by: Stephen Ferg | last post by:
I have a question that is not directly Python-related. But I thought I'd ask the most erudite group that I know... :-) When did Windows start accepting the forward slash as a path separator character? At one time, it was accepted as a truism that Windows (like MS-DOS) was different from Unix because Windows used the backslash as the path...
1
1174
by: Dmitry N.Ananyev | last post by:
Hello friends! I am start my first ASP practic in VS2005. **** My table ****************************** <table> <tr> <td></td> </tr> <tr>
6
2537
by: Nad | last post by:
Hello, In order to go back to the previous page from a page with possible postbacks I keep Request.Referrer in ViewState and then use it to redirect to the previous page. However I am losing all the information entered in the previous page. I also want to keep the entries in many fields/controls in the previous page. Is there a way to...
5
6446
by: many_years_after | last post by:
Hi, pythoners: There is a problem I couldn't dispose. I start a thread in the my program. The thread will do something before executing time.sleep(). When the user give a signal to the main thread (such as click the 'end' button or close the window), the thread should end it's running. But how to end the threading when it's sleeping? I set...
2
1138
by: jvb | last post by:
Hey all, I have a quick question, I want to have my application startup when the user logs into their machine and I am not sure how to do it. Is it a registry setting?
5
2352
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi, I posted last week about a problem I've got and didn't get any responses, but I've managed to come up with a workaround and a possible cause (guessing). I was wondering if someone could confirm my theories and give me some information on the proper way to handle this. I have a search results web page that is opened with info in the...
1
1903
by: CL4life | last post by:
I have the following problem: a program, located on drive a known drive (for example lets say drive C:) needs to execute a program on an unknown different drive (a USB device which doesn't have the same drive letter in each PC). Locating this program isn't the problem, I'm just letting my main application check the root directory's of all drives...
3
8281
by: ghd | last post by:
In Windows XP when does the JVM start (JRE version 1.4 and higher)? And when does it halt? Does the JVM start when we launch a java application (or by executing on the command prompt - java classfile)? And does the JVM halt when the all the java applications on the system end? According to the documentation, the JVM halts in two situations:...
1
1322
by: robc2236 | last post by:
ok i am making a program to manage my mame roms that runns in fullscreen the problem is when i play a rom from it my program minimizes and stays minimized even when mame has closed is there any way i can add some code to my prgram so when mame closes for my program to go back to fullscreen automatically
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.