Tuesday, August 28, 2007

PRINT SERIES (VARIABLE)

WAP to print series from start to end using do-while loop

void main ()

{

int a,b;

clrscr ();

printf ("Enter Start: ");

scanf ("%d",&a);

printf ("Enter End: ");

scanf ("%d",&b);

do

{

printf ("%d\n",a);

a++;

}

while (a<=b);

getch ();

}


No comments:

Post a Comment