solve this please....

i need to show, the result like this...
------------------------------
example :
insert date 7/5/2000
insert date 1/3/1999
insert date 12/2/2003
the earliest date is 1/3/1999
-----------------------------

// this is my coding please correct... someone help...
#include <stdio.h>
#include <conio.h>
#define x 20

int main() {
int dd[x],mm[x],yy[x],i,n,b,c,d,q,w,e;
b=0; c=0; d=0;
do {
for(i=1; i<=100; i++)
{
printf("insert date dd/mm/yy ");
scanf("%d/%d/%d",&dd[i],&mm[i],&yy[i]);
q=dd[i]; w=mm[i]; e=yy[i];
if(q==0 || w==0 || e==0)
{
goto hitung;
}
if(e<d)
{
b=q; c=w; d=e;
}
if(w<c)
{
b=q; c=w; d=e;
}
if(b<q)
{
b=q; c=w; d=e;
}
}
}
while(b!=0 && c!=0 && d!=0);
hitung:
printf("earlier date is : %d/%d/%d \n",b,c,d);

getch();
}
Last edited on
closed account (zb0S216C)
Use [_code_][/_code_] tags, please (without the underscores).

Did you design your program before starting to code it? Chances are, you didn't and now you've hit a wall. This reason alone should convince you to design programs prior to development. Go back, design your program, then re-write it. If you're still having trouble, post your design (flow chart) and we'll see what happens.

If this is homework, then I'm sure your tutor would like to see how your program works internally.

Have a good day, sir.

Wazzak
Last edited on
Topic archived. No new replies allowed.