Sie sind auf Seite 1von 7

TALLER DE CICLOS CON COUT

Presentado a:

Miguel Ángel Tovar Cardozo.

UNIVERSIDAD ANTONIO NARIÑO

SEDE-BUGANVILES

NEIVA-HUILA

2016
TALLER DE CICLOS CON COUT

Presentado a:

Miguel Ángel Tovar Cardozo.

Presentado por:

Stefanny Tavera polania

UNIVERSIDAD ANTONIO NARIÑO

SEDE-BUGANVILES

NEIVA-HUILA

2016
1) Calcular el promedio de un alumno que tiene 7 calificaciones en la materia de
Diseño

Estructurado de Algoritmos

#include <iostream>

#include <stdlib.h>

#include <conio.h>

#include <string.h>

#include <stdio.h>

using namespace std;

int main(int argc, char *argv[]) {

system("color z2");

string nom;

float sum,c,calif,prom;

sum = 0;

cout<<"Por favor ingrese su nombre"<<endl;

cin>>nom;

for (c=1;c<=7;c++)

cout<<"Ingrese sus calificaciones"<<endl;

cin>>calif;

sum = sum+calif;

prom = sum/7;

cout<<"Señor/a "<<nom<<" Su promedio es de: "<<prom;

getch();
return 0;

2) Leer 10 números y obtener su cubo y su cuarta.

#include <iostream>

#include <stdlib.h>

#include <stdlib.h>

#include <math.h>

using namespace std;

int numero, cont;

float cubo, cuarta;

int main(int argc, char *argv[]) {

cout<<"Usando cout y cin"<<endl<<endl;

for (cont=1;cont<=10;cont++)

cout<<"ingrese el"<<cont<< "numero"<<endl;

cin>>numero;

cubo=

return 0;

3) Leer 10 números e imprimir solamente los números positivos

#include<iostream>

using namespace std;

int main() {

float n;
float num;

for (n=1;n<=10;n++) {

cout << "numeros" << endl;

cin >> num;

if (num>0) {

cout << "su numero es " << num << endl;

return 0;

4) Leer 20 números e imprimir cuantos son positivos, cuantos negativos y cuantos


neutros.

#include<iostream>

using namespace std;

int main() {

float cn, cneg, cp, n,x;

cp = 0;

cn = 0;

cneg = 0;

for (x=1;x<=20;x++) {

cout << "INGRESE EL NUMERO" << endl;

cin >> n;

if (n==0) {

cn = cn+1;
} else {

if (n>0) {

cp = cp+1;

} else {

cneg = cneg+1;

cout << cn << endl;

cout << cp << endl;

cout << cneg << endl;

return 0;

5) Leer 15 números negativos y convertirlos a positivos e imprimir dichos números.

#include<iostream>

using namespace std;

int main() {

float n,np,x;

n = 0;

np = 0;

for (x=1;x<=15;x++) {

cout << "INTRODUCIR UN NUMERO" << endl;

cin >> n;

if (n<0) {
np = n*(-1);

cout << n << endl;

cout << np << endl;

return 0;

6) Suponga que se tiene un conjunto de calificaciones de un grupo de 40 alumnos.


Realizar algoritmo para calcular la calificación media y la calificación más baja de
todo el grupo.

7) Calcular e imprimir la tabla de multiplicar de un número cualquiera. Imprimir el


multiplicando, el multiplicador y el producto.

8) Simular el comportamiento de un reloj digital, imprimiendo la hora, minutos y


segundos de un día desde las 0:00:00 horas hasta las 23:59:59 horas

Das könnte Ihnen auch gefallen