Documentos de Académico
Documentos de Profesional
Documentos de Cultura
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int main ()
{
int Vec[100], k=0, Num=0, ContNum=0;
printf("Ingrese un número: '\n);
scanf( "%d", &Num);
for (k=0;k<=99;k++){
printf("Ingrese un número: \n");
scanf( "%d", &Vec[k]);
if (Num==Vec[k]){
ContNum++; }}
return 0;
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int main ()
{
int k=0, Num=0;
char VecLetreas[10];
for (k=0;k<=9;k++){
printf("Ingrese una vocal minuscula \n");
scanf( "%c", &VecLetreas[k]);
if((VecLetreas[k]=='a')|| (VecLetreas[k]=='e')|| (VecLetreas[k]=='i')){
if ((VecLetreas[k]=='o')|| (VecLetreas[k]=='u')){
printf("Se a almacenado la vocal %c, en la posicion %d. \n",
VecLetreas[k], k);}}
return 0;
}
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int main ()
{
int k=0, ValMay=0,ValMen=0,Position=0, VecNum[50];
for (k=0;k<=49;k++){
printf("Ingrese un número: \n");
scanf( "%d", &VecNum[k]);
if (ValMay<VecNum[k]){
ValMay=VecNum[k];
Position=k;}
else {
ValMen= VecNum[k];
Position=k;
}}
return 0;
}
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int main ()
{
int k=0, Arrelo[50],Prom=0,ContProm=0,Sum=0;
for (k=0;k<=49;k++){
printf("Ingrese un número: \n");
scanf( "%d", &Arreglo[k]);
if (7<Arreglo[k]){
ContNum++;
else {
if (Arreglo[k]>=8 && Arreglo[k]<=48 ){
Prom+=Arreglo[k];
ContProm++;}
else {
Sum+=Arreglo[k];
}
}
return 0;
}
5. Escribir un algoritmo que realice las siguientes operaciones:
a. Leer 20 números cualquiera y almacenarlos en un vector
llamado arr
b. Calcular e imprimir el promedio de elementos impares y el
promedio de elementos pares almacenados en un vector.
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int main ()
{
int k=0, Arr[20],PromP=0,ContPromP=0,PromI=0,ContPromI=0;
for (k=0;k<=19;k++){
printf("Ingrese un número: \n");
scanf( "%d", &Arr[k]);
if (Arr[k]%2=0){
PromP+=Arr[k];
ContPromP++;}
else {
PromI+=Arr[k];
ContProm+I+;}
}
return 0;
}