Kedor
New Member
I am newbie in Programming but i want try some.. and i want ask if its possible to make (in console Aplication) to show some text
let say for example "HiHo"
in center of screen? i could make like
.........................HiHo..............................
but...
and i got 1 question:
i am learning so thats rly easy program but...
its asking you to give 1 number and its making "a * a" and giving result after that
and then its working perfectly
but when i will write "z" for example when its asking for "a" the program will start making while loop and it will never end.. but it should ask for "wybor2" in every loop.. why its not doing that when i will give wrong "a" number?
and if i will write "z" after giving a (i mean when its asking for wybor2) it will work correctly
let say for example "HiHo"
in center of screen? i could make like
.........................HiHo..............................
but...
and i got 1 question:
PHP:
Pole_kw:
cout << endl << endl << endl << "Write a: ";
cin >> a;
pole = a * a;
cout << endl << endl << "Number a = " << a << endl << "And a * a = " << pole << endl << endl << endl;
while (1) {
cout << endl << endl <<"What now?" << endl;
cout << "-----------------------" << endl;
cout << "1. Give other a" << endl;
cout << "m. Back To menu" << endl;
cout << "q. Quit" << endl;
cin >> wybor2;
switch (wybor2){
case '1': system("CLS"); goto Pole_kw;
case 'm': system("CLS"); goto Poczatek;
case 'q': system("CLS"); goto Koniec;
default: system("CLS"); cout << "Wrong choose! choose again"; continue;
}}
i am learning so thats rly easy program but...
its asking you to give 1 number and its making "a * a" and giving result after that
and then its working perfectly
but when i will write "z" for example when its asking for "a" the program will start making while loop and it will never end.. but it should ask for "wybor2" in every loop.. why its not doing that when i will give wrong "a" number?
and if i will write "z" after giving a (i mean when its asking for wybor2) it will work correctly
Last edited: