jueves, 21 de julio de 2016

FUNCIÓN NUMEROS PRIMOS

#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#include <math.h>
int funcion_pri( int v1[])
{
int p=0;
 for( int x=0; x<10; x++)
 {   if(v1[x]%2==0)
       {
       p=p+1;
       }
 }
return p;
}
int main()
{
 int v1[10],f=9;
 gotoxy(19,3);cout<<"INSTITUTO TECNOLOGICO SUPERIOR HUAQUILLAS";
gotoxy(32,4);cout<<"...LENIN ZAPATA....";
gotoxy(30,6);cout<<"FUNCION NUMEROS PRIMOS";
gotoxy(10,7);cout<<"INBRESE 10 NUMEROS";
 for( int x=0; x<10; x++)
 {
 gotoxy(15,f);cout<<x+1<<": ";cin>> v1[x];

 f++;
  }
   gotoxy(30,10);cout<<"NUMEROS PRIMOS IMGRESADOS: "<<funcion_pri(v1);
  getch();
  }

No hay comentarios:

Publicar un comentario