Question: can any one remove error from below code i posted 3 files and error i got is frtablecollect2.exe [Error] ld returned 1 exit status //main.c

can any one remove error from below code i posted 3 files and error i got is \frtable\collect2.exe [Error] ld returned 1 exit status

//main.c

#include

#include

#include "tt.h"

int main(int argc, char *argv[])

{

int x;

int y; int tt[10][10];

write_tt(tt);

read_tt(tt);

printf(" Enter two numbers to multiply, e.g. 5 5: 9 4 ");

scanf("%d %d", &x, &y);

printf(" %d x %d = %d ",x, y, result_tt(tt, x, y));

return 0; }

//tt.c

#include

#include

#include

#include "tt.h"

void write_tt(int tt[][10])

{

int row;

int col;

int num;

for (row = 10; row > 0; row--)

{

for (col = 10; col > 0; col--) { num = row * col; tt[abs(row-10)][abs(col-10)]=num; } }

}

void read_tt(int tt[][10])

{

int row, col; printf(" Reading timetable from array "); for (row = 0; row < 10; row++)

{

for (col = 0; col < 10; col++) { printf("%3d ", tt[row][col]); } printf(" "); } printf(" End reading array ");

}

int result_tt(int tt[][10], int x, int y)

{ int result; if(x>10 || y > 10 || x < 0 || y < 0){ printf("Invalid values. Value should be less than 10 and not negative"); exit(0); } result = tt[abs(x-10)][abs(y-10)]; return result; }

#ifndef tt_h

#define tt_h

int x;

int y; int tt[10][10];

void write_tt(int tt[][10]);

void read_tt(int tt[][10]);

int result_tt(int tt[][10], int x, int y);

#endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!