# it is always giving the same output which is "you entered wrong letter"

 hilmi kumdakçı · January 22, 2015 last version of my code :#include #include #include using namespace std;int main(){ string a,A,V;    double b,x,y,z; cout<<"Which one is leading phase?\nV or A?"<>a; cout<<"What is the phase difference which is expressed in degrees ?"<>b; cout<<"What is the peak value of V?"<>y; cout<<"What is the peak value of A"<>z; if(a=="V") {    for(double x=1; x<200;x++){ cout<

## Replies

 hilmi kumdakçı · January 25, 2015 ? have done it by using fstream . thanx Çağlan Turgut · January 25, 2015 2. If you mean command prompt, well it has a black background on Windows but its equivalents on other operating systems(terminals) have different background colors(Mac OS X >> White; Ubuntu >> Purple). You can output to an application window;Using your target Operating Systems API or You can use a Third Party Cross-Platform library like QT (https://www.thenewboston.com/videos.php?cat=57) or SDL (too advanced for this,not recommended). You can output to a file;Using fstream (there are other ways too, but this is the easiest) !Keep in mind that some text readers might have black background! hilmi kumdakçı · January 23, 2015 thanks for all ur answers . I have done it but have some questions. btw was trying to get a voltage and amper values in som seconds which are going with 50hz.  after some  calculations found tihs values and ? added two more variables to indicate amplitude of them . anyway;1. the grogram gives me 0.57 as a value of sin(0.635) (for x=1) it does not make sense . the rest values are also incorrect . i changed library and made it math.h but it is still incorrect .(i handled with this problem it gives me the value in terms of radian i converted it to degree)2. is there any way to write the output to a file or something else which is seen nicer than black screen ?3. after 200 loops it gave me the output "you entered wrong letter " . how can i avoid from it ? Bernard Pyc0d333 Parah · January 23, 2015 yea Val. true. Val Almosnino · January 23, 2015 V and A are string values and need to be surrounded by double quotes in your if statements....if(a=="V")...if(a=="A")... Bernard Pyc0d333 Parah · January 23, 2015 ``#include #include #include using namespace std;int main(){string a,A,V; // YOU DECLARED THEM AS STRINGS.double b,x;cout<<"Which one is leading phase?\nV or A?"<>a;cout<<"what is the phase difference which is expressed in degrees ?"<>b;if(a=="V")   //V HAS BEEN DECLARED AS A STRING, SO YOUR COMPARISON SHOULD BE WITH A STRING{    for(double x=1; x<200;x++)   {cout<
• 1

## C++

129,908 followers