programando:
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
cout<<"cuantos positivos hay entre el rango de 321 y 484"<
int i,w;
w=0;
for (i=322;i<484;i=i+1) w="w+1;"> cout<<"hay: "<
system("PAUSE");
return EXIT_SUCCESS;
}
2. Realizar un algortimo que lea 10 numeros ingresados por teclado y determine cuantos son positivo,negativo o iguales a cero:
programado:
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
cout<<"progrma q lee 10 # ingresados x tclado y dtrmina cuantos son positivos,"<
int k,w,d,f,e;
e=0;
f=0;
d=0;
for (w=1;w<=10;w=w+1)
{
cout<<"ingrec k x favor: "<
if(k==0)
{
e=e+1;
}
else
if(k<0)
{
f=f+1;
}
else
d=d+1;
}
cout<<"hay: "<
system("PAUSE");
return EXIT_SUCCESS;
}
No hay comentarios:
Publicar un comentario