In the given code there is no syntax error but still not executable, showing "linker: module definition file" as default.Plz help me out.
Code:
#include<stdio.h>
int n;
float Moment=0, Weight=0;
float lcg;
void main()
{
struct ship_tank
{
float weight;
float LCG;
};
struct ship_tank A[20];
int i;
for(i=1;i<=n;i++)
{
printf("Enter the numbers of tanks: ");
scanf("%d",&i);
printf("Enter the weight of tank%d: " );
scanf("%f",& A[i].weight);
printf("Enter the LCG of tank%d: ");
scanf("%f",& A[i].LCG);
Moment= Moment + A[i].weight*A[i].LCG;
Weight= Weight + A[i].weight;
lcg = Moment/Weight;
printf(" The lcg is: %f", lcg);
}
}