#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define n 4
void main()
{
//variables
float table[n];
int no=1,i;
float x=0;
float d;
clrscr();
//program
for (i=0; i<n; i++)
{
printf("Enter the number %d : ", i);
scanf("%f", &table[i]);
}
for (i=0; i<n; i++)
{
if(x==0 && i!=0)
no=0;
else
x=table[i];
}
if (no==0)
printf("\nThe division cannot be made");
else
{
d=table[0];
for(i=1;i<n;i++)
d=d/table[i];
printf("\nThe division is %f ", d);
}
getch();
}
It will Help you !
Majestics
Practically a Master Poster
621 posts since Jul 2007
Reputation Points: 199
Solved Threads: 49
Try using periods every once in a while.
Maybe english isn't her primary language?
bwjones
Junior Poster in Training
70 posts since Jul 2005
Reputation Points: 10
Solved Threads: 1
Maybe english isn't her primary language?
Regardless, it is still a good suggestion.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
It will Help you !
Why this is bad help:
1) No CODE tags
2) No formatting, code is very difficult to read. See this
3) #include<conio.h> -- not portable. Do not use.
4) void main() -- see this
5) clrscr(); -- only 1 compiler defines this function - do not use
6) getch(); -- not portable. Use standard C instead, like getchar() barbiegirl,
Please explain what you want in detail. Your explanation is lacking in data necessary to understand your problem. Did you read the post titled Read Me: Read This Before Posting ?
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
I have given this program only to develop your logic ,it is not a standard form .
Majestics
Practically a Master Poster
621 posts since Jul 2007
Reputation Points: 199
Solved Threads: 49
I have given this program only to develop your logic ,it is not a standard form .
And where in your original post did you explain that? So how is the person you're trying to help going to know your program is only a logic lesson? And with all the problems, how is he going to know what is good and what is bad since he's new to programming?
IOW, don't help people by showing bad code because it's confusing and does more harm than good. Show an algorithm rather than code if you can't post good stuff. For one, they can learn more from a good algorithm. And, secondly, they can't turnyour work to get a good grade. They have to still write it themselves.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Well......... I know its a mistake but i want her to study these things , every time u cannot write what is going on and what is not , and if a person use 1% of his/her brain he/she can know what does that mean ............
Majestics
Practically a Master Poster
621 posts since Jul 2007
Reputation Points: 199
Solved Threads: 49