<?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>Comentarios en: Encontrar el número mayor de un conjunto</title>
	<atom:link href="http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/feed" rel="self" type="application/rss+xml" />
	<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto</link>
	<description>Ayuda para tu tarea en C++</description>
	<lastBuildDate>Fri, 03 Feb 2012 03:04:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Por: mike</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-3140</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Sun, 04 Dec 2011 03:55:52 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-3140</guid>
		<description>#include
#include
#include
main()
{clrscr();
	int num, cant, x,num_mayor=0,p;
	printf(&quot;Cuantos números desea ingresar: &quot;);
	scanf(&quot;%d&quot;,&amp;cant);
		for(x=1;xnum_mayor)
			{
			num_mayor=num;
			p=x;
			}
			
		}
printf(&quot;el numero mayor fue %d y su posición es %d&quot;,num_mayor,p);
getch();
return(0);
}</description>
		<content:encoded><![CDATA[<p>#include<br />
#include<br />
#include<br />
main()<br />
{clrscr();<br />
	int num, cant, x,num_mayor=0,p;<br />
	printf(&#8220;Cuantos números desea ingresar: &#8220;);<br />
	scanf(&#8220;%d&#8221;,&amp;cant);<br />
		for(x=1;xnum_mayor)<br />
			{<br />
			num_mayor=num;<br />
			p=x;<br />
			}</p>
<p>		}<br />
printf(&#8220;el numero mayor fue %d y su posición es %d&#8221;,num_mayor,p);<br />
getch();<br />
return(0);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: samuel</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2934</link>
		<dc:creator>samuel</dc:creator>
		<pubDate>Fri, 28 Oct 2011 04:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2934</guid>
		<description>disculpa esto me sirvio un buen pero como le puedo acer para saber cual es el mayor osea imaginemos que tenemos el mismo codigo y cuando lo corres introduces esto

1=5
2=34
3=20

entonces el mayor es el 34 pero ademas de eso quiero que me imprima que el segundo numero es 34 y es el mayor 
espero y me puedas dar una idea</description>
		<content:encoded><![CDATA[<p>disculpa esto me sirvio un buen pero como le puedo acer para saber cual es el mayor osea imaginemos que tenemos el mismo codigo y cuando lo corres introduces esto</p>
<p>1=5<br />
2=34<br />
3=20</p>
<p>entonces el mayor es el 34 pero ademas de eso quiero que me imprima que el segundo numero es 34 y es el mayor<br />
espero y me puedas dar una idea</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: ANDRES</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2874</link>
		<dc:creator>ANDRES</dc:creator>
		<pubDate>Thu, 13 Oct 2011 21:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2874</guid>
		<description>Viejo quiero un programa similar pero con n números ingresados hasta que dé la orden, ¿como sería?</description>
		<content:encoded><![CDATA[<p>Viejo quiero un programa similar pero con n números ingresados hasta que dé la orden, ¿como sería?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: mika</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2758</link>
		<dc:creator>mika</dc:creator>
		<pubDate>Fri, 30 Sep 2011 11:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2758</guid>
		<description>a mi me salto cualkiera O.o</description>
		<content:encoded><![CDATA[<p>a mi me salto cualkiera O.o</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: TOÑO</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2612</link>
		<dc:creator>TOÑO</dc:creator>
		<pubDate>Fri, 26 Aug 2011 05:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2612</guid>
		<description>MUCHAS MUCHAS MUCHAS RECONTRA MUCHAS GRACIAS ME SIRVIO GRACIAS MAN !</description>
		<content:encoded><![CDATA[<p>MUCHAS MUCHAS MUCHAS RECONTRA MUCHAS GRACIAS ME SIRVIO GRACIAS MAN !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: angie</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2562</link>
		<dc:creator>angie</dc:creator>
		<pubDate>Sun, 14 Aug 2011 00:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2562</guid>
		<description>hola! tengo un problema... quiero sacar el maximo de 3 numeros que comando uso?? uso lenguaje c++</description>
		<content:encoded><![CDATA[<p>hola! tengo un problema&#8230; quiero sacar el maximo de 3 numeros que comando uso?? uso lenguaje c++</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: THEbatzuk</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2167</link>
		<dc:creator>THEbatzuk</dc:creator>
		<pubDate>Mon, 02 May 2011 22:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2167</guid>
		<description>Pues en realidad tu código tal como lo pusiste aquí no estaba funcionando, pero supongo que fueron errores de teclado. Este sí:
&lt;pre lang=&quot;cpp&quot;&gt;#include&lt;iostream&gt;
using namespace std;
int main()
{
    int n_num=0,num=0,elmayor=0,c=0,elmenor=2147483647;
    cin &gt;&gt; n_num;
    for(c=1;c&lt;=n_num;c++)
    {
        cout &lt;&lt;&quot;\nIntroduce el numero &quot;; cin &gt;&gt; num;
        if(num&gt;elmayor)
        {
            elmayor=num;
        }
        else if(num&lt;elmenor)
        {
            elmenor=num;
        }
    }
    cout &lt;&lt;&quot;\n\tEl numero mayor fue el &quot; &lt;&lt; elmayor;
    cout &lt;&lt;&quot;\n\tEl numero menor fue el &quot; &lt;&lt; elmenor;
    cin.get();cin.get();
    return 0;
}&lt;/pre&gt;

Y si lo analizas paso a paso es muy fácil de entender. Al principio la variable &#039;elmayor&#039; vale 0, luego entras al ciclo y pides el primer número, si el número es mayor que &#039;elmayor&#039; entonces la variable se modifica con el nuevo valor. Vuelves a pedir otro número y lo vuelve a comparar con el nuevo valor... y así. Lo mismo para &#039;elmenor&#039; solo que esta variable tiene que tener un valor inicial muy alto (yo busqué en internet el número más grande que puede tener una variable int y es el que le puse) para que al inicio el número que pides sea menor que &#039;elmenor&#039;.</description>
		<content:encoded><![CDATA[<p>Pues en realidad tu código tal como lo pusiste aquí no estaba funcionando, pero supongo que fueron errores de teclado. Este sí:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include&lt;iostream&gt;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">int</span> n_num<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>,num<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>,elmayor<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>,c<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>,elmenor<span style="color: #000080;">=</span><span style="color: #0000dd;">2147483647</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> n_num<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span>c<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>c<span style="color: #000080;">&lt;=</span>n_num<span style="color: #008080;">;</span>c<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Introduce el numero &quot;</span><span style="color: #008080;">;</span> <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> num<span style="color: #008080;">;</span>
        <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>num<span style="color: #000080;">&gt;</span>elmayor<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            elmayor<span style="color: #000080;">=</span>num<span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>num<span style="color: #000080;">&lt;</span>elmenor<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            elmenor<span style="color: #000080;">=</span>num<span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>El numero mayor fue el &quot;</span> <span style="color: #000080;">&lt;&lt;</span> elmayor<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>El numero menor fue el &quot;</span> <span style="color: #000080;">&lt;&lt;</span> elmenor<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cin</span>.<span style="color: #007788;">get</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><span style="color: #0000dd;">cin</span>.<span style="color: #007788;">get</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Y si lo analizas paso a paso es muy fácil de entender. Al principio la variable &#8216;elmayor&#8217; vale 0, luego entras al ciclo y pides el primer número, si el número es mayor que &#8216;elmayor&#8217; entonces la variable se modifica con el nuevo valor. Vuelves a pedir otro número y lo vuelve a comparar con el nuevo valor&#8230; y así. Lo mismo para &#8216;elmenor&#8217; solo que esta variable tiene que tener un valor inicial muy alto (yo busqué en internet el número más grande que puede tener una variable int y es el que le puse) para que al inicio el número que pides sea menor que &#8216;elmenor&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: THEbatzuk</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2166</link>
		<dc:creator>THEbatzuk</dc:creator>
		<pubDate>Mon, 02 May 2011 22:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2166</guid>
		<description>Si aparece, pero tengo que aprobarlo primero :)</description>
		<content:encoded><![CDATA[<p>Si aparece, pero tengo que aprobarlo primero :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Danyel</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2163</link>
		<dc:creator>Danyel</dc:creator>
		<pubDate>Mon, 02 May 2011 03:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2163</guid>
		<description>Ke pedoo!! por que no aparece todo el codigo que pongo??</description>
		<content:encoded><![CDATA[<p>Ke pedoo!! por que no aparece todo el codigo que pongo??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Danyel</title>
		<link>http://codigoc.org/300-encontrar-el-numero-mayor-de-un-conjunto/comment-page-1#comment-2161</link>
		<dc:creator>Danyel</dc:creator>
		<pubDate>Mon, 02 May 2011 03:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://codigoc.org/?p=300#comment-2161</guid>
		<description>Perdon por el doble comentario pero me equivoque en el codigo, era:

#include 
int main()
{
  int n_num=0,num=0,elmayor=0,c=0,elmenor;
  cout &lt;&gt; n_num;
  for(c=1;c&lt;=n_num;c++)
  {
    cout &lt;&lt;&quot;\nIntroduce el numero &quot; &lt;&lt; c &lt;&gt; num;
    if(num&gt;elmayor)
    {
      elmayor=num;
    }
    else if(num&lt;elmenor)
    {
     elmenor=num;
    }
  }

  cout &lt;&lt;&quot;\n\tEl numero mayor fue el &quot; &lt;&lt; elmayor;
  cout &lt;&lt;&quot;\n\tEl numero menor fue el &quot; &lt;&lt; elmenor;
  cin.get();cin.get();

  return 0;
}</description>
		<content:encoded><![CDATA[<p>Perdon por el doble comentario pero me equivoque en el codigo, era:</p>
<p>#include<br />
int main()<br />
{<br />
  int n_num=0,num=0,elmayor=0,c=0,elmenor;<br />
  cout &lt;&gt; n_num;<br />
  for(c=1;c&lt;=n_num;c++)<br />
  {<br />
    cout &lt;&lt;&quot;\nIntroduce el numero &quot; &lt;&lt; c &lt;&gt; num;<br />
    if(num&gt;elmayor)<br />
    {<br />
      elmayor=num;<br />
    }<br />
    else if(num&lt;elmenor)<br />
    {<br />
     elmenor=num;<br />
    }<br />
  }</p>
<p>  cout &lt;&lt;&quot;\n\tEl numero mayor fue el &quot; &lt;&lt; elmayor;<br />
  cout &lt;&lt;&quot;\n\tEl numero menor fue el &quot; &lt;&lt; elmenor;<br />
  cin.get();cin.get();</p>
<p>  return 0;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

