miércoles, 20 de julio de 2016

FACTORIAL DE CINCO NUMEROS UTILIZANDO DOS VECTORES.

#include <conio.h>
#include <stdio.h>
#include <iostream.h>
//CLEAR UN VECTOR DE 4 ELEMENTOS, PRESENTE UN SEGUNDO VECTOR QUE CONTENGA EL
//RESULTADO FACTORIAL DEL PRIMER VECTOR
void main()
{
int v1[4],v2[4],r=1,n,f=9,ff=9, ii=1;
gotoxy(19,2);cout<<"INSTITUTO TECNOLOGICO SUPERIOR HUAQUILLAS";
gotoxy(32,3);cout<<"...LENIN ZAPATA....";
gotoxy(13,4);cout<<"FACTORIAL DE CINCO NUMEROS UTILIZANDO DOS VECTORES.";
gotoxy(5,7); cout<<" LLENE EL VECTOR";
 for(int i=0;i<=3; i++)
 {
  gotoxy(5,f);cout<<ii<<".-";
  gotoxy(13,f);cin>>v1[i];
                for(n=1;n<=v1[i];n++)
   { r=r*n; }
  v2[i]=r; r=1;f++;ii++;
 }
 gotoxy(30,7); cout<<"V_FACTORIAL";
 for(int i=0;i<=3;i++)
 { gotoxy(22,ff);cout<<"----->";
                gotoxy(35,ff); cout<<v2[i];ff++; }
 getch();

}


No hay comentarios:

Publicar un comentario