the array-of-squares program to also print cubes.

int main()
{
int i;
int squares[11]; /* [0..10]; [0] ignored */
int cubes[11];
/* fill arrays: */
for(i = 1; i <= 10; i = i + 1)
{
squares[i] = i * i;
cubes[i] = i * i * i;
}
/* print table: */
printf("n\tsquare\tcube\n");
for(i = 1; i <= 10; i = i + 1)
printf("%d\t%d\t%d\n", i, squares[i], cubes[i]);
return 0;
}

2 comments:

  1. can you help me to write a program that compute all the matrix operation such as addition,subtraction,multiplication and transpose using array and function in C language????

    ReplyDelete
  2. Yes Sure friend please mail me your requirement at hellopankajin@rediff.com

    ReplyDelete