counter

Free Hit Counter

C program to print the squares of natural numbers

Q: program to print 1,2,4,6,16,....


#include
#include
void main()
{
int i=1,p=1;
clrscr();
printf("%d\n",i);
while(p<64)
{
p=(p*2);
printf("%d\n",p);
}
getch();

}

No comments:

Post a Comment