Respuesta:
Programa conjunto de 20 numeros enteros CMM
Explicación:
#include <iostream>
using namespace std;
int main () {
int i;
int menores=0;
int mayores=0;
int entre=0;
int conjunto[10]= {3, 5, 20, 42, 10, 34, 50, 100, 70, 47};
i=0;
while(i <10)
{
// cout<<conjunto[i]<<"\n";
if( conjunto[i] <15)
menores = menores+1;
}
else if(conjunto[i]>50)
cout<<conjunto[i]<<"\n";
mayores= mayores+1;
else if(conjunto[i]>=45 and conjunto[i] <=55)
entre= entre+1;
i= i+1;
cout<<"Menores de 15: "<<menores<<"\n";
cout<<"Mayores de 50: "<<mayores<<"\n";
cout<<"Entre 45 y 55: "<<entre<<"\n";
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2025 KUDO.TIPS - All rights reserved.
Respuesta:
Programa conjunto de 20 numeros enteros CMM
Explicación:
#include <iostream>
using namespace std;
int main () {
int i;
int menores=0;
int mayores=0;
int entre=0;
int conjunto[10]= {3, 5, 20, 42, 10, 34, 50, 100, 70, 47};
i=0;
while(i <10)
{
// cout<<conjunto[i]<<"\n";
if( conjunto[i] <15)
{
menores = menores+1;
}
else if(conjunto[i]>50)
{
cout<<conjunto[i]<<"\n";
mayores= mayores+1;
}
else if(conjunto[i]>=45 and conjunto[i] <=55)
{
entre= entre+1;
}
i= i+1;
}
cout<<"Menores de 15: "<<menores<<"\n";
cout<<"Mayores de 50: "<<mayores<<"\n";
cout<<"Entre 45 y 55: "<<entre<<"\n";
}