Program to Print Square of 1 to 10 Numbers



#include

int main()
{
int index, square;

for(index = 1 ; index <=10 ; index = index + 1)
{
square = index * index;
printf("%5d%5d\n", index, square);
}

return 0;
}



/* OutPut of Program

1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

*/








No comments:

Post a Comment