<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 2.10 &#8212; Comprehensive quiz</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Umbra</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-96676</link>
		<dc:creator>Umbra</dc:creator>
		<pubDate>Sun, 18 Dec 2011 07:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-96676</guid>
		<description>I&#039;ve stumbled upon this site on a mission to revitalize my 10-years dormant C++ coding avocation. I thoroughly enjoyed my experience to this point but could not hold back registering after I took this quiz.

While my answers correctly anticipated the solutions, I can&#039;t help but wonder if the use of unsigned long int (for cents -- reformatted to dollars and cents) isn&#039;t more appropriate for a stock price variable, as the potential for rounding errors begin to creep in at the upper end of where inflated prices are heading.

:) j/k

great job!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve stumbled upon this site on a mission to revitalize my 10-years dormant C++ coding avocation. I thoroughly enjoyed my experience to this point but could not hold back registering after I took this quiz.</p>
<p>While my answers correctly anticipated the solutions, I can&#8217;t help but wonder if the use of unsigned long int (for cents &#8212; reformatted to dollars and cents) isn&#8217;t more appropriate for a stock price variable, as the potential for rounding errors begin to creep in at the upper end of where inflated prices are heading.</p>
<p>:) j/k</p>
<p>great job!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xero</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-96433</link>
		<dc:creator>xero</dc:creator>
		<pubDate>Tue, 22 Nov 2011 10:57:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-96433</guid>
		<description>My code for question number 4 is:
#include 
double InputNumber()
{
    using namespace std;
    cout &lt;&lt; &quot;Insert the digit&quot; &lt;&gt; fDigit;
    return fDigit;

}

char InputOperand()
{
    using namespace std;
    cout &lt;&lt; &quot;Insert operator (+,-,*,/)&quot; &lt;&gt; chOperator;
    return chOperator;
}

void calculation()
{
    calculator:
    using namespace std;
    double digitOne = InputNumber();
    double digitTwo = InputNumber();
    char operand = InputOperand();
    if (operand==&#039;+&#039;)
    cout &lt;&lt; &quot;Sum of both the digits is &quot; &lt;&lt; (digitOne + digitTwo) &lt;&lt; endl;
    else
        if (operand==&#039;-&#039;)
        cout &lt;&lt; &quot;Subtracting both digits results into &quot; &lt;&lt; (digitOne - digitTwo) &lt;&lt; endl;
        else
            if (operand==&#039;*&#039;)
            cout &lt;&lt; &quot;Multiplying both digits results into &quot; &lt;&lt; (digitOne * digitTwo) &lt;&lt; endl;
            else
                if (operand==&#039;/&#039;)
                cout &lt;&lt; &quot;Dividing both digits results into &quot; &lt;&lt; (digitOne / digitTwo) &lt;&lt; endl;
                else
                cout &lt;&lt; &quot;You have inserted an invalid operator. Restart the Program&quot; &lt;&lt; endl;
}

int main()
{
    calculation();
    return 0;
}</description>
		<content:encoded><![CDATA[<p>My code for question number 4 is:<br />
#include<br />
double InputNumber()<br />
{<br />
    using namespace std;<br />
    cout &lt;&lt; &quot;Insert the digit&quot; &lt;&gt; fDigit;<br />
    return fDigit;</p>
<p>}</p>
<p>char InputOperand()<br />
{<br />
    using namespace std;<br />
    cout &lt;&lt; &quot;Insert operator (+,-,*,/)&quot; &lt;&gt; chOperator;<br />
    return chOperator;<br />
}</p>
<p>void calculation()<br />
{<br />
    calculator:<br />
    using namespace std;<br />
    double digitOne = InputNumber();<br />
    double digitTwo = InputNumber();<br />
    char operand = InputOperand();<br />
    if (operand==&#8217;+')<br />
    cout &lt;&lt; &quot;Sum of both the digits is &quot; &lt;&lt; (digitOne + digitTwo) &lt;&lt; endl;<br />
    else<br />
        if (operand==&#039;-&#039;)<br />
        cout &lt;&lt; &quot;Subtracting both digits results into &quot; &lt;&lt; (digitOne &#8211; digitTwo) &lt;&lt; endl;<br />
        else<br />
            if (operand==&#039;*&#039;)<br />
            cout &lt;&lt; &quot;Multiplying both digits results into &quot; &lt;&lt; (digitOne * digitTwo) &lt;&lt; endl;<br />
            else<br />
                if (operand==&#039;/&#039;)<br />
                cout &lt;&lt; &quot;Dividing both digits results into &quot; &lt;&lt; (digitOne / digitTwo) &lt;&lt; endl;<br />
                else<br />
                cout &lt;&lt; &quot;You have inserted an invalid operator. Restart the Program&quot; &lt;&lt; endl;<br />
}</p>
<p>int main()<br />
{<br />
    calculation();<br />
    return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95516</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 31 May 2011 17:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95516</guid>
		<description>1) stop using system(&quot;Pause&quot;). Google it and you&#039;ll understand why. Seriously.
2) try using else if statements.</description>
		<content:encoded><![CDATA[<p>1) stop using system(&#8220;Pause&#8221;). Google it and you&#8217;ll understand why. Seriously.<br />
2) try using else if statements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tux</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95514</link>
		<dc:creator>tux</dc:creator>
		<pubDate>Tue, 31 May 2011 14:21:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95514</guid>
		<description>can anybody help me this code? 

#include 

using namespace std;

int main()
{
	
	cout &lt;&gt; x;
	cout &lt;&gt; y;
	cout &lt;&gt; chUserInput;
	
	
	if(chUserInput == &#039; + &#039;)
		cout &lt;&lt; x &lt;&lt; &quot; + &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x + y &lt;&lt; endl;		
	if(chUserInput == &#039; - &#039;)
		cout &lt;&lt; x &lt;&lt; &quot; - &quot;  &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x - y &lt;&lt; endl;		
	if(chUserInput == &#039; * &#039;)
		cout &lt;&lt; x &lt;&lt; &quot; * &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x * y &lt;&lt; endl;		
	 if(chUserInput == &#039; / &#039;)
		 cout &lt;&lt; x &lt;&lt; &quot; / &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x / y &lt;&lt; endl;


	system(&quot;pause&quot;);
    return 0;
}

it will run but when i enter the numbers it will not print the results only &quot;press any key to continue&quot; but when i copy/paste the example of ALEX it will print the results... i&#039;m a newbie and want to learn C++ coz itz a mind twister programming IMHO.thnx to ALEX for his great tutorials.</description>
		<content:encoded><![CDATA[<p>can anybody help me this code? </p>
<p>#include </p>
<p>using namespace std;</p>
<p>int main()<br />
{</p>
<p>	cout &lt;&gt; x;<br />
	cout &lt;&gt; y;<br />
	cout &lt;&gt; chUserInput;</p>
<p>	if(chUserInput == &#8216; + &#8216;)<br />
		cout &lt;&lt; x &lt;&lt; &quot; + &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x + y &lt;&lt; endl;<br />
	if(chUserInput == &#039; &#8211; &#039;)<br />
		cout &lt;&lt; x &lt;&lt; &quot; &#8211; &quot;  &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x &#8211; y &lt;&lt; endl;<br />
	if(chUserInput == &#039; * &#039;)<br />
		cout &lt;&lt; x &lt;&lt; &quot; * &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x * y &lt;&lt; endl;<br />
	 if(chUserInput == &#039; / &#039;)<br />
		 cout &lt;&lt; x &lt;&lt; &quot; / &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; x / y &lt;&lt; endl;</p>
<p>	system(&quot;pause&quot;);<br />
    return 0;<br />
}</p>
<p>it will run but when i enter the numbers it will not print the results only &quot;press any key to continue&quot; but when i copy/paste the example of ALEX it will print the results&#8230; i&#039;m a newbie and want to learn C++ coz itz a mind twister programming IMHO.thnx to ALEX for his great tutorials.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave_K</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95471</link>
		<dc:creator>Dave_K</dc:creator>
		<pubDate>Wed, 18 May 2011 15:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95471</guid>
		<description>else if

In other words if you have:

&lt;code&gt;
if (x == y)
//some code here
else if (x == z)
//some code here
else
//other code
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>else if</p>
<p>In other words if you have:</p>
<p><code><br />
if (x == y)<br />
//some code here<br />
else if (x == z)<br />
//some code here<br />
else<br />
//other code<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave_K</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95470</link>
		<dc:creator>Dave_K</dc:creator>
		<pubDate>Wed, 18 May 2011 15:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95470</guid>
		<description>So I made the program and probably made it entirely too complex however, I did it for the purpose of modularization. While I realize this program has a very simple result I&#039;m trying to get in good coding habits. Here is my code, any suggestions? (Also I added a bit of functionality to the if statement after playing with it):
&lt;code&gt;
 //Learncpp.com Ch2.10 Quiz question 4
/*Program will take 2 floating point numbers from the user,
ask them for an operator (+, -, *, /) and then output the
result of the mathematical operation.*/

#include &quot;io.h&quot;

int main()
{
	writeAnswer();

    return 0;
}

//I/O functions for the program

#include &lt;iostream&gt;

//Asks the user for the first number
double firstNumber()
{
	using namespace std;

	//Get floating point number from user.
	cout &lt;&lt; &quot;Enter a number (can be a decimal): &quot;;
	double dFirstNum;
	cin &gt;&gt; dFirstNum;

	return dFirstNum;
}

//Asks the user for the second number
double secondNumber()
{
	using namespace std;

	//Get floating point number from user
	cout &lt;&lt; &quot;Enter another number (can be a decimal): &quot;;
	double dSecondNum;
	cin &gt;&gt; dSecondNum;

	return dSecondNum;
}

//Asks the user for a mathematical operator
char enterOperator()
{
	using namespace std;

	//Get a mathematical operator from user (+, -, *, /)
	cout &lt;&lt; &quot;Enter an operator (+, -, *, /): &quot;;
	char	chOperator;
	cin &gt;&gt;	chOperator;

	return chOperator;
}

//Outputs the answer to the console
void writeAnswer()
{
	using namespace std;

	//Get equation from user
	double	dFirstNum	= firstNumber();
	char	chOper		= enterOperator();
	double	dSecondNum	= secondNumber();

	//Check to make sure the equation is valid and output the answer
	if (chOper == &#039;+&#039;)
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; + &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum + dSecondNum &lt;&lt; endl;
	else if (chOper == &#039;-&#039;)
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; - &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum - dSecondNum &lt;&lt; endl;
	else if (chOper == &#039;*&#039;)
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; * &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum * dSecondNum &lt;&lt; endl;
	else if (chOper == &#039;/&#039;)
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; / &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum / dSecondNum &lt;&lt; endl;
	else
	{
		cout &lt;&lt; &quot;Invalid operator entry.&quot; &lt;&lt; endl;
		writeAnswer();
	}
}

//I/O prototypes for program
#ifndef IO_H
#define IO_H

double	firstNumber();
double	secondNumber();
char	userOperator();
void	writeAnswer();

#endif
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>So I made the program and probably made it entirely too complex however, I did it for the purpose of modularization. While I realize this program has a very simple result I&#8217;m trying to get in good coding habits. Here is my code, any suggestions? (Also I added a bit of functionality to the if statement after playing with it):<br />
<code><br />
 //Learncpp.com Ch2.10 Quiz question 4<br />
/*Program will take 2 floating point numbers from the user,<br />
ask them for an operator (+, -, *, /) and then output the<br />
result of the mathematical operation.*/</p>
<p>#include &quot;io.h&quot;</p>
<p>int main()<br />
{<br />
	writeAnswer();</p>
<p>    return 0;<br />
}</p>
<p>//I/O functions for the program</p>
<p>#include &lt;iostream&gt;</p>
<p>//Asks the user for the first number<br />
double firstNumber()<br />
{<br />
	using namespace std;</p>
<p>	//Get floating point number from user.<br />
	cout &lt;&lt; &quot;Enter a number (can be a decimal): &quot;;<br />
	double dFirstNum;<br />
	cin &gt;&gt; dFirstNum;</p>
<p>	return dFirstNum;<br />
}</p>
<p>//Asks the user for the second number<br />
double secondNumber()<br />
{<br />
	using namespace std;</p>
<p>	//Get floating point number from user<br />
	cout &lt;&lt; &quot;Enter another number (can be a decimal): &quot;;<br />
	double dSecondNum;<br />
	cin &gt;&gt; dSecondNum;</p>
<p>	return dSecondNum;<br />
}</p>
<p>//Asks the user for a mathematical operator<br />
char enterOperator()<br />
{<br />
	using namespace std;</p>
<p>	//Get a mathematical operator from user (+, -, *, /)<br />
	cout &lt;&lt; &quot;Enter an operator (+, -, *, /): &quot;;<br />
	char	chOperator;<br />
	cin &gt;&gt;	chOperator;</p>
<p>	return chOperator;<br />
}</p>
<p>//Outputs the answer to the console<br />
void writeAnswer()<br />
{<br />
	using namespace std;</p>
<p>	//Get equation from user<br />
	double	dFirstNum	= firstNumber();<br />
	char	chOper		= enterOperator();<br />
	double	dSecondNum	= secondNumber();</p>
<p>	//Check to make sure the equation is valid and output the answer<br />
	if (chOper == &#039;+&#039;)<br />
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; + &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum + dSecondNum &lt;&lt; endl;<br />
	else if (chOper == &#039;-&#039;)<br />
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; - &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum - dSecondNum &lt;&lt; endl;<br />
	else if (chOper == &#039;*&#039;)<br />
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; * &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum * dSecondNum &lt;&lt; endl;<br />
	else if (chOper == &#039;/&#039;)<br />
		cout &lt;&lt; dFirstNum &lt;&lt; &quot; / &quot; &lt;&lt; dSecondNum &lt;&lt; &quot; = &quot; &lt;&lt; dFirstNum / dSecondNum &lt;&lt; endl;<br />
	else<br />
	{<br />
		cout &lt;&lt; &quot;Invalid operator entry.&quot; &lt;&lt; endl;<br />
		writeAnswer();<br />
	}<br />
}</p>
<p>//I/O prototypes for program<br />
#ifndef IO_H<br />
#define IO_H</p>
<p>double	firstNumber();<br />
double	secondNumber();<br />
char	userOperator();<br />
void	writeAnswer();</p>
<p>#endif<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95443</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Fri, 13 May 2011 17:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95443</guid>
		<description>1) use doubles, not floats
2) use else if&#039;s, makes the code to look less confusing. Also it&#039;s probably the reason your code fails.</description>
		<content:encoded><![CDATA[<p>1) use doubles, not floats<br />
2) use else if&#8217;s, makes the code to look less confusing. Also it&#8217;s probably the reason your code fails.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95442</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Fri, 13 May 2011 16:59:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95442</guid>
		<description>Today I learned that I like to make stuff more complicated than it should be. 
Anyway, I found what seemed to be two mistakes in the 3rd exercise - 
You wrote &quot;a) unsigned char unAgeInYears;&quot;, while it&#039;s a char, and you said to use &#039;n&#039; for int variables.</description>
		<content:encoded><![CDATA[<p>Today I learned that I like to make stuff more complicated than it should be.<br />
Anyway, I found what seemed to be two mistakes in the 3rd exercise &#8211;<br />
You wrote &#8220;a) unsigned char unAgeInYears;&#8221;, while it&#8217;s a char, and you said to use &#8216;n&#8217; for int variables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amirabbas</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95346</link>
		<dc:creator>amirabbas</dc:creator>
		<pubDate>Thu, 21 Apr 2011 11:27:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95346</guid>
		<description>#include 
#include 
int main()
{ 
    int a,b;
    int s;
    char ch;
cout&lt;&gt; a;
cin &gt;&gt; b;
cout&lt;&gt; ch;
s=(int)ch;
cout &lt;&lt;&quot; a&quot;&lt;&lt;ch&lt;&lt;&quot;b :&quot;;
//if ((int)ch==42) cout&lt;&lt; (a*b);
//else if ((int)ch==43) cout&lt;&lt; (a+b);
//else if ((int)ch==45) cout&lt;&lt; (a-b);
//else if ((int)ch==47) cout&lt;&lt; (a/b);
switch(s)
{
               case 94:cout&lt;&lt;(a^b);break;
               case 37:cout&lt;&lt;a%b;break;
               case 42:cout&lt;&lt;a*b;break;
               case 43:cout&lt;&lt;a+b;break;
               case 45:cout&lt;&lt;a-b;break;
               case 47:cout&lt;&lt;a/b;break;
               default : cout&lt;&gt; a;
return 0;
}</description>
		<content:encoded><![CDATA[<p>#include<br />
#include<br />
int main()<br />
{<br />
    int a,b;<br />
    int s;<br />
    char ch;<br />
cout&lt;&gt; a;<br />
cin &gt;&gt; b;<br />
cout&lt;&gt; ch;<br />
s=(int)ch;<br />
cout &lt;&lt;&quot; a&quot;&lt;&lt;ch&lt;&lt;&quot;b :&quot;;<br />
//if ((int)ch==42) cout&lt;&lt; (a*b);<br />
//else if ((int)ch==43) cout&lt;&lt; (a+b);<br />
//else if ((int)ch==45) cout&lt;&lt; (a-b);<br />
//else if ((int)ch==47) cout&lt;&lt; (a/b);<br />
switch(s)<br />
{<br />
               case 94:cout&lt;&lt;(a^b);break;<br />
               case 37:cout&lt;&lt;a%b;break;<br />
               case 42:cout&lt;&lt;a*b;break;<br />
               case 43:cout&lt;&lt;a+b;break;<br />
               case 45:cout&lt;&lt;a-b;break;<br />
               case 47:cout&lt;&lt;a/b;break;<br />
               default : cout&lt;&gt; a;<br />
return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dominator_X</title>
		<link>http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/comment-page-1/#comment-95236</link>
		<dc:creator>Dominator_X</dc:creator>
		<pubDate>Mon, 07 Mar 2011 12:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/210-comprehensive-quiz/#comment-95236</guid>
		<description>Hello! Why did you use in 

01	#include 
02	 
03	int main()
04	{
05	    using namespace std;
06	    cout &lt;&gt; dX;
09	 
10	    cout &lt;&gt; dY;
13	 
14	    cout &lt;&gt; chChoice;
17	 
18	    if (chChoice == &#039;+&#039;)
19	        cout &lt;&lt; dX &lt;&lt; &quot; + &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX + dY &lt;&lt; endl;
20	    if (chChoice == &#039;-&#039;)
21	        cout &lt;&lt; dX &lt;&lt; &quot; - &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX - dY &lt;&lt; endl;
22	    if (chChoice == &#039;*&#039;)
23	        cout &lt;&lt; dX &lt;&lt; &quot; * &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX * dY &lt;&lt; endl;
24	    if (chChoice == &#039;/&#039;)
25	        cout &lt;&lt; dX &lt;&lt; &quot; / &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX / dY &lt;&lt; endl;
26	 
27	    return 0;
28	}


Double instead of integer type?</description>
		<content:encoded><![CDATA[<p>Hello! Why did you use in </p>
<p>01	#include<br />
02<br />
03	int main()<br />
04	{<br />
05	    using namespace std;<br />
06	    cout &lt;&gt; dX;<br />
09<br />
10	    cout &lt;&gt; dY;<br />
13<br />
14	    cout &lt;&gt; chChoice;<br />
17<br />
18	    if (chChoice == &#8216;+&#8217;)<br />
19	        cout &lt;&lt; dX &lt;&lt; &quot; + &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX + dY &lt;&lt; endl;<br />
20	    if (chChoice == &#039;-&#039;)<br />
21	        cout &lt;&lt; dX &lt;&lt; &quot; &#8211; &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX &#8211; dY &lt;&lt; endl;<br />
22	    if (chChoice == &#039;*&#039;)<br />
23	        cout &lt;&lt; dX &lt;&lt; &quot; * &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX * dY &lt;&lt; endl;<br />
24	    if (chChoice == &#039;/&#039;)<br />
25	        cout &lt;&lt; dX &lt;&lt; &quot; / &quot; &lt;&lt; dY &lt;&lt; &quot; is &quot; &lt;&lt; dX / dY &lt;&lt; endl;<br />
26<br />
27	    return 0;<br />
28	}</p>
<p>Double instead of integer type?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

