sábado, 24 de noviembre de 2012

PROGRAMA QUE MUESTRA 20 NUMEROS PARES Y 20 IMPARES

REALIZAR UN PROGRAMA QUE GENERE LOS 20 PRIMEROS NUMEROS PARES Y LOS 20 PRIMEROS NUMEROS IMPARES. ESTA REALIZADO  EN LENGUAJE C++.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>

void main (void)
{
int i=0, k=0;
textcolor(5);
textbackground(8);
clrscr();
gotoxy(15,2);printf("PROGRAMA QUE MUESTRA LOS NUMEROS PARES E IMPARES");
for(i=1,k=2;i<=20,k<=20;i+=2,k+=2)
{
gotoxy(15,6);cout<<"numeros impares";
gotoxy(i+i,10);cout<<i;
gotoxy(15,14);cout<<"numeros pares";
gotoxy(k+k,18);cout<<k;
}
getch();
}

No hay comentarios:

Publicar un comentario