I am supposed to write a C program with a function selectTable that accepts values for numbers, tablesize, and increment in which the numbers increase by and produce a table with those inputs. What am I doing wrong?
Code:
#include<stdio.h>
#include<stdlib.h>
#pragmawarning (disable:4996)
int main()
{
void selectTable(float, float, float);
float tablesize, numbers, increment;
printf("Ener the table size: ");
scanf("%f", &tablesize);
printf("Enter the number to begin with: ");
scanf("%f", &numbers);
printf("Enter the increment the numbers will increase by: ");
scanf("%f", &increment);
selectTable(numbers, tablesize, increment);
system("pause");
return 0;
}
void selectTable(float numbers, float tablesize, float increment)
{
int i;
printf("NUMBER SQUARE CUBE \n");
printf("------ ------ ---- \n");
i = 0;
for (numbers; numbers += increment;)
for (i = numbers; i <= (numbers + (tablesize - 1) * increment);
i += increment);
printf("%f %f %f\n", numbers, numbers * numbers,
numbers * numbers * numbers);
}