You are on page 1of 2

Ejercicio 1

#include <stdio.h>

#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input
loop */

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

int n,c,x,p,t;

printf ("introducir n");

scanf ("%d",&n);

c=1;

p=2;

x=0;

t=3;

while (c<=n)

printf ("%d,",x);

c= c+1;

x= x-1;

if (c<=n){

printf ("%d,",p);

p=p+2;
c=c+1;

if (c<=n){

printf ("%d,", t);

t=t+3;

c= c+1;

You might also like