Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

10.

#include <iostream>
using namespace std;

int main()
{
int n1,n2,contador=0;
cout << "Ingrese el limite inferior: ";
cin >> n1;
cout << "Ingrese el limite superior: ";
cin >> n2;
cout << "Los numeros pares en el rango dado: ";
n1++;
while(n1 < n2){
if(n1%2 == 0){
cout << n1 << " ";
contador++;
}
n1++;
}
cout << "\nEn total hay " << contador <<" numeros pares";
return 0;
}
11 y 12.
https://www.youtube.com/watch?v=qhAfARG7Ggo
9.

http://www.elai.upm.es/webantigua/spain/Asignaturas/FundaInfo/EjerciciosPracticas2.pdf

7.

#include <iostream.h>

#include <conio.h>

void main()

int r;

int i;

cout<<"NUMERO CUADRADO"<<endl;

cout<<"======================================"<<endl;

for(i=0;i<11;i++)
{

cout<<i<<" ";

r=i*i;

cout<<r<<" ";

cout<<endl;

getch();

You might also like