Can you tell me what you need to write in a simple code so that after the function is executed it returns to the beginning?
That is, roughly speaking, started up again.
Code:
#include <stdio.h> #include <iostream> #include <locale.h> #include <conio.h> using namespace std; int main () { setlocale (0, ""); int x = 0; int y = 0; int z = 0; cout << "Введите числа х, y" << endl; cin >> x; cin >> y; z = x + y; cout <<"z = "<< z << endl; _getch(); return 1; }
while
? Read, you will surely enjoy. - VladD==
, and not=
(a=
means assignment). * If you have set;
afterwhile
, thus you declare the loop body empty - remove the semicolon. * conditions inwhile
do not necessarily check a numeric variable, there can be any condition, any expression of typebool
. In particular, the constant. - VladD