hi everyone :), i wanted to create a little program with makes the divisions of the elements of a table i wanted to create a loop which will indicate if there's a number in the table then we should c "the division cannot be made", if not we will get the result,the problem is it doesnt work, u may try it n it wont, i know u will say wht is the utility of such stuff, well im just new to C so im tryin with basics,o_O enough talkin here's my source code
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define n 4
void main()
{
//variables
double table[n]={0};
long no=1,i;
double x=0,d;
//program
for (i=0; i<n; i++)
{
printf("enter the number %d", i);
scanf("%f", &table[i]);
}
printf("gr8\n");
printf("%f", table[0]/table[1]);//this is just to c if it works
for (i=0; i<n; i++)
{
do
{
if(x==0)
no=0;
x=table[i+1];
}
while (x!=0);
}
if (no==0)
printf("the division cannot be made");
else
d=table[0]/table[1]/table[2]/table[3];
printf("the division is %f", d);
system("pause");
}
plz help me solving this, i spent almost a week thinking about it
thank u for ur help