0
Why does the Compiler ask for input before showing Output?
cout<<"Wie hiess die ehemalige Landeshauptstadt Deutschlands mit Sitz in NRW?"<<endl; cout<<"a) Duisburg"<<endl<<"b) Essen"<<endl<<"c) Bonn"<<endl; cin>>answ; that is a part of my Code for a little Quiz I'm building but when I want to run it in the Compiler of this App it FIRST asks for input before even showing the question. Thanks im advance for every Kind of help
13 Answers
+ 2
The compiler in this app does not work like an usual compiler. Compile the code using a true C++ Compiler and it should work fine.
This is because this app sends the data over the Internet to compile it, and not locally so it is actually being ran on another computer and the result is sent back to you. As said, compile it on your computer and it should work fine.
+ 1
ummm......what compiler are you using...
+ 1
.....or online good compilers like codechief or others (google it) you can do it from your phone too
0
Can I see all code? and please in english,it hard to read
0
#include <iostream>
#include <string>
using namespace std;
int main() {
char answ, r_answ;
string q, a, b, c, player, h_player;
int points, high;
cout<<"What is the name of the former capital of germany which was located in Northrine Westfalia?"<<endl;
cout<<"a) Duisburg"<<endl<<"b) Essen"<<endl<<"c) Bonn"<<endl;
cin>>answ;
if(answ==c){
cout<<"Correct Answer!";
}
else{
cout<<"Wrong answer...";
}
return 0;
}
0
Oh understand what you want now.You want to see question and answer,right?
0
I want the Compiler to print first the question + possible answers and THEN Demand an input but somehow it asks for an input before printing ANYthing
0
Yep it's same.I think You must make delay time for cin.One code can do but I already forget :P.
0
never had a Problem like that xd
0
Arrr I'm really confuse wanna submit button or ikkyusan?
0
me too
0
Thanks for the last answer that's what I needed to know xD
0
bro What kind of that program on phone?