ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

EJERCICIOS DE ARREGLOS.


Enviado por   •  2 de Marzo de 2016  •  Tareas  •  331 Palabras (2 Páginas)  •  155 Visitas

Página 1 de 2

EJERCICIOS DE ARREGLOS

CLAUDIE SHANNON VILLAMAR RAMÍREZ

PROFESOR JOSE GILBERTO MOLINA

UNIVERSIDAD NACIONAL DE COLOMBIA
FACULTAD DE INGENIERÍA
PROGRAMACIÓN DE COMPUTADORES
2015

EJERCICIO 14

#include

using namespace std;

int main(){

    int X[5];

    int b;

    int c=4;

    int d=0;

    for(int i=0;i<4;i++){

        cout<<"ingrese un numero:";

        cin>>b;

    if(b==0){

        X[c]=b;

        c--;  }

    else {

            X[d]=b;

        d++;} }

       for(int i=0;i<8;i++)  {

           cout<<" "<

return 0;}

[pic 1]

EJERCICIO 15

#include

using namespace std;

int pot (int x,int y){

    if (y==0)

    {return 1;   }

    return pot (x,y-1)*x;}

int main(){

    int a;

 cout<<"ingrese la dimension: ";

    cin>>a;

    int K[a];

    int i;

    int suma=0;

    for ( i=0;i

        cout<<"ingrese un numero: ";

        cin>>K[i];}

for(i=0;i

    cout<

cout<

for (i=a-1;i>=0;i--)  {

  cout<

      for(i=0;i

{suma=suma + K[i]*(pot(2,i));}

cout<

return 0;}

                

                

                [pic 2]

EJERCICIO 13

#include

using namespace std;

main() {

int x,n[5],z=0;

float me;

cout<<"Digitar los numeros del arreglo ";

for(x=0;x<5;x++) {

cout<<"nnumero "<

cin>>n[x];

z=+z+n[x]; }

me=z/5;

cout<<"la mediana es: "<

return 0; }

        [pic 3]

...

Descargar como (para miembros actualizados)  txt (2 Kb)   pdf (107 Kb)   docx (118 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com