Could you please help me with this question using C not C Wr

Could you please help me with this question using C not C++

Write a program that calculates the squares and cubes of the numbers from 0 to 10 and use tabs to print the following table of values: (You should use for-statement.)

Solution

#include <stdio.h>

int main(void)
{
   int num;
   printf(\"\ number\\t\\tsquare\\t\\tcube\");
   for(num=0;num<=10;num++) // for loop to compute square and cube of number starting from 0 to 10
   {
       printf(\"\ %d\\t\\t%d\\t\\t%d\",i,i*i,i*i*i); // use of \\t tabs
      
   }
   return 0;
}

output:

Could you please help me with this question using C not C++ Write a program that calculates the squares and cubes of the numbers from 0 to 10 and use tabs to pr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site