answersLogoWhite

0

#include<stdio.h>

const unsigned int rows = 10;

const unsigned int cols = 3;

int table[rows][cols];

int square (const int n) {

return n * n;

}

int cube (const int n) {

return n * n * n;

}

void initialise_table (void) {

int x, y, val;

for (x=0; x<rows; ++x) {

val = x+1;

table[x][0] = val;

table[x][1] = square (val);

table[x][2] = cube (val);

}

}

int main (void) {

int x, y;

initialise_table ();

printf ("Value\tSquare\tCube\n");

for (x=0; x<rows; ++x) {

printf("%d\t%d\t%d\n", table[x][0], table[x][1], table[x][2]);

}

return 0;

}

User Avatar

Wiki User

9y ago

What else can I help you with?

Continue Learning about Engineering

Write a C Program to print sum of squares of odd numbers?

#include


Write algorithm compute sum of square of N numbers?

Oh, what a lovely question! To compute the sum of the squares of N numbers, you can create a simple algorithm. Start by initializing a variable to hold the sum, then loop through each number, square it, and add it to the sum. Once you've done this for all N numbers, you'll have the sum of their squares. Just like painting a happy little tree, take your time and enjoy the process.


Write a C program to calculate the sum of squares of numbers from 1 to N?

#include &lt;iostream&gt; using namespace std; int main() { int i,sum; // variables sum = 0; // initialize sum /* recursive addition of squares */ for (i = 1; i &lt;= 30; i++) sum = sum + (i * i); cout &lt;&lt; sum &lt;&lt;" is the sum of the first 30 squares." &lt;&lt; endl; return 0; }


What is rls algorithm?

The Recursive least squares RLS adaptive filter is an algorithm which recursively finds the filter coefficients that minimize a weighted linear least squares cost function relating to the input signals. This is in contrast to other algorithms such as the least mean squares LMS that aim to reduce the mean square error. In the derivation of the RLS, the input signals are considered deterministic, while for the LMS and similar algorithm they are considered stochastic. Compared to most of its competitors, the RLS exhibits extremely fast convergence. However, this benefit comes at the cost of high computational complexity.


Do all squares have corners?

Yes squares ALWAYS have corners but they can be a sharp point or a very slightly rounded edge. Hope this helps!!

Related Questions

Sn is a function that squares numbers Find S13 when Sn n2?

169


Sn is a function that squares numbers Find S12 when Sn n2?

144


Sn is a function that squares numbers Find S11 when Sn equals n2?

121


S n is a function that squares numbers Find S13 when Sn equals n2?

169


What is the next number in the sequence 25 36 49 64?

81. They are the perfect squares of numbers starting from 5.81. They are the perfect squares of numbers starting from 5.81. They are the perfect squares of numbers starting from 5.81. They are the perfect squares of numbers starting from 5.


Which numbers are NOT perfect squares?

In the complex field, every number is a square so there are no numbers that are not squares. If the domain is reduced to that of real numbers, any negative number is not a square. However, the term "square numbers" (not number's!) is often used to refer to perfect square numbers. These are numbers that are squares of integers. Therefore the squares of fractions or Irrational Numbers are non-squares.


Are no perfect squares whole numbers?

By definition, ALL perfect squares are whole numbers!


Perfect squares?

Natural numbers which are the scales of some natural numbers are perfect squares


What is the sum of squares in Excel?

It squares numbers and add the totals together. The square of 2 is 4, the square of 5 is 25. The sum of squares of 2 and 5 is therefore 29. That would done in the SUMSQ function like this: =SUMSQ(2,5)


How are perfect squares and irrational squares same?

No. Perfect squares as the squares of the integers, whereas irrational squares as the squares of irrational numbers, but some irrational numbers squared are whole numbers, eg &radic;2 (an irrational number) squared is a whole number.


Numbers that have an odd number of factors are what?

perfect squares


What are numbers that have an odd amount of factors called?

perfect squares also known as square numbers taytay