Historiologia

Páginas: 9 (2055 palabras) Publicado: 17 de octubre de 2012
http://www.youtube.com/watch?v=INX_IhSVocE
Problema 3.1
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>
main ()
{
float sumpar,sumimp,propar;
int num,i,cuepar;
sumpar=0;
sumimp=0;
cuepar=0;
i=1;
while (i<=270)
{
printf("ingrese cantidad:");
scanf("%d",&num);
if(num!=0)
{
if((pow(-1,num))>0)
{
sumpar=sumpar+num;cuepar=cuepar+1;
}
else
{
sumimp=sumimp+num;
}
}
i=i+1;
}
propar=sumpar/cuepar;
printf("El promedio de los numeros es:%.2f",propar);
printf("Acumulador de los numeros imp:%.2f",sumimp);
getch();
}

Problema 3.2

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>
#include <string.h>
main ()
{
int sumser,i;
charband[1];
band[1]=='t';
sumser=0;
i=2;
while(i<=1800)
{
sumser=sumser+1;
printf("%d\n",i);
if(band[1]=='t')
{
band[1]=='t';
i=i+3;
}
else
{
band[1]=='t';
i=i+2;
}
}
printf("serie %d\n",sumser);
getch();
}

Problema 3.3

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>
main ()
{
int i,n;
char band[1];
float serie;serie=0;
band[1]='t';
i=1;
printf("ingrese cantidad de numeros de Serie:\t");
scanf("%d",&n);
while(i<=n)
{
if(band[1]=='t')
{
serie=(serie+1)/i;
band[1]='f';
}
else
{
serie=(serie-1)/i;
band[1]='t';
}
i=i++;
}
printf("serie:%f\n",serie);
getch();
}

Problema 3.4
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>main ()
{
float sue,nom,nsue;
nom=0;
printf("ingrese sueldo de trabajador:\t");
scanf("%d",&sue);
while(sue!=-1)
{
if(sue<=1000)
{
nsue=sue*1.15;
}
else
{
nsue=sue*1.12;
}
nom=nom+nsue;
printf("el nuevo sueldo del trabajador es:%.2f",nsue);
printf("\n Ingrese sueldo del trabajador:\t");
scanf("%d",&sue);
}
printf("nuevo sueldo:%.2f\n",nom);
getch();
}Problema 3.5

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>
main ()
{
int n, num,i,cuepos;
float sumpos,sumotr,progen,propos;
sumotr=0;
sumpos=0;
cuepos=0;
printf("\tingrese cantidad de datos\n");
scanf("%d",&n);
i=1;
while(i<=n)
{
printf("ingrese numero:");
scanf("%d",&num);
if(num>0)
{
sumpos=sumpos+num;cuepos=cuepos+1;
}
else
{
sumotr=sumotr+num;
}
i=i++;
}
progen=(sumpos+sumotr);
propos=(sumpos/cuepos);
printf("\n los numeros positivos son:%d",cuepos);
printf("\n el promedio de numeros positivos es:%g",propos);
printf("\n el promedio general es:%g",progen);
getch();
}

Problema 3.6

#include <stdio.h>
#include <conio.h>
#include <math.h>
main ()
{
inti,n,num,may,men;
printf("ingrese datos\n");
scanf("%d",&n);
i=1;
while(i<=n)
{
printf("ingrese numero\n");
scanf("%d",&num);
if(i==1)
{
may=num;
men=num;
}
else
{
if(num>may)
may=num;
else
if(num<men)
men=num;
}
i=i++;
}
printf("\nmayor:%d \nmenor:%d",may,men);
getch();
}

Problema 3.7#include <stdio.h>
#include <conio.h>
#include <math.h>
main ()
{
int i=1, chi=0, med=0, gra=0, n=0;
float v=0;
printf("ingrese los datos\n");
scanf("%d",&n);
do{
printf("ingrese la venta\n");
scanf("%f",&v);
if(v<=200)
{
chi=chi++;
}
else
{
if(v<400)
{
med=med++;
}
else
{
gra=gra++;
}
}
i=i++;
}
while(i<=n);
printf("\nMenores:%d\nMedianas:%d \nMayores:%d",chi,med,gra);
getch();
}

Problema 3.8

#include <stdio.h>
#include <conio.h>
#include <math.h>
main ()
{
int num=0;
printf("ingrese numero negativo\n");
printf("ingrese el dato\n");
scanf("%d",&num);
if(num>0)
do
{
printf("\n%d",num);
if(pow(-1,num)>0)
{
num=num/2;
}
else
{
num=(num*3)+1;
}
}
while(num!=1);
else
{...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Historiologia
  • historiologia
  • Historiología e Historiografía
  • Historiologia
  • historiologia
  • Historiología y filosfía de la historia
  • LA HISTORIOLOGIA ESCATOL GICA
  • HISTORIA E HISTORIOLOGIA DEL DERECHO EN LA EPOCA CONTEMPORANEA

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS