source file name: While4.C
void main()
{
int n;
int sq,c;
clrscr();
printf(" square and cube numbers between 1 to 25 ");
n=1;
while(n<=25)
{
sq=n*n;
c=n*n*n;
printf("\n %d %d %d ",n,sq,c);
n++;
}
getch();
}
output:
source file name: While4.C
void main()
{
int n;
int sq,c;
clrscr();
printf(" square and cube numbers between 1 to 25 ");
n=1;
while(n<=25)
{
sq=n*n;
c=n*n*n;
printf("\n %d %d %d ",n,sq,c);
n++;
}
getch();
}
output:
0 Comments
Post a Comment