Tuesday, August 28, 2007

SQUARE & CUBE

WAP to print series from 1 to 10 & find its square and cube


void main ()

{

int a=1,sqr=0,cube=0;

clrscr ();

while (a<=10)

{

sqr=pow(a,2);

cube=pow(a,3);

printf ("%d\t %d\t %d\n",a,sqr,cube);

a++;

}

getch ();

}



No comments:

Post a Comment