sudhanshu


{ City } kochi
< Country > india
* Profession * student
User No # 59406
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 3
Users Marked my Answers as Wrong # 8
Questions / { sudhanshu }
Questions Answers Category Views Company eMail




Answers / { sudhanshu }

Question { 2786 }

at first i'm using
datediff('d', a.due_date, current_date);
but it takes too long to get the result
but how can i subtract the current_date - a.due_date
and still get the same result like when i use datediff?
thank you


Answer


for getting date difference you can use it.......

select to_days(now())- to_days(date);


for example-


SELECT TO_DAYS(NOW())- TO_DAYS('2010-12-01');




TO_DAYS(DATE) command return a number which is total no. of
days between '0000-01-01' and the given date.





Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 5571 }

prog. to produce 1
2 3
4 5 6
7 8 9 10


Answer

#include
#include

void main()
{
int nol,i,j,k=1,l=1;
clrscr();
printf("Enter the no. of line: ");
scanf("%d",&nol);
for(i=nol*2;i>=2; i=i-2)
{
printf("\n\n");
for(j=1;j<=i;j++)
printf(" ");

for(j=1;j<=l;j++)
printf("%2d ",k++);
l++;
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No


Question { Vodafone, 59917 }

how many zeros are there at the end of product between 1 to
100


Answer

25

Is This Answer Correct ?    2 Yes 7 No

Question { TCS, 6687 }

what is the probability that 4 numbers selected from 1 to 40
are not consecutive.


Answer

there may be 74 group of consecutive numbers...
1,2,3,4
2,3,4,5
.....
.....
37,38,39,40
and their reverse as
4,3,2,1
5,4,3,2
.....
....
40,39,38,37

total no. of ways to arrange 4 numbers out of 40 = 40 P 4

probability= 1 - ( 2*37 / 40*39*38*37 )
= 29639 /29640

Is This Answer Correct ?    1 Yes 1 No