sábado, 24 de noviembre de 2012

PROGRAMA PARA CALCULAR LOS NUMEROS NEUTROS,POSITIVOS Y NEGATIVOS

 PROGRAMA PARA CALCULAR 10 NUMEROS QUE EL USUARIO INGRESE Y EL PROGRAMA MUESTRE CUANTOS DE ESOS SON NEUTROS, CUANTOS POSITIVOS Y CUANTOS NEGATIVOS. ESTA REALIZADO EN LENGUAJE C++.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main (void)
{
float num;
int i=0,cneu=0,cpos=0,cneg=0;
textcolor(6);
textbackground(8);
clrscr();
gotoxy(12,2);cout<<"PROGRAMA PARA CALCULAR NUMEROS NEUTROS,POSITIVOS Y NEGATIVOS";
for(i=1;i<=10;i++)
{
gotoxy(12,8);cout<<"digite 10 numeros";
gotoxy(12,10);cin>>num;
gotoxy(12,11);cout<<"    ";
gotoxy(12,10);cout<<num;
if(num==0)
{
cneu=cneu+1;
}
else
if(num>0)
{
cpos=cpos+1;
}
else
if(num<0)
{
cneg=cneg+1;
}
}
gotoxy(10,8);cout<<"la cantidad de neutros es: "<<cneu;
gotoxy(10,10);cout<<"la cantidad de positivos es: "<<cpos;
gotoxy(10,12);cout<<"la cantidad de negativos es: "<<cneg;
getch();
}

No hay comentarios:

Publicar un comentario