ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories >> Code-Snippets
 
 


 

Back to Questions Page
 
Question
How to test whether two strings are equal or not ?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Use strcmp(s1,s2) and see the corresponding int values..Its
either 0 or 1.
 
0
Sandeep
 
 
Question
code to calculate the number of days between two dates
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
function getDaysMinusWeekend(startDay, startMonth, 
startYear, endDay, endMonth, endYear) {	var sdate = new Date
();	var edate = new Date();	var odays = 0;	var total = 
0; 	sdate.setFullYear(startYear,startMonth,startDay);
	edate.setFullYear(endYear,endMonth,endDay); 
	odays = 6 - sdate.getDay();	if(odays == 6) {
		odays = 0;	} 	sdate.setFullYear
(startYear,startMonth,startDay + odays); 	return 
Math.floor(((((edate.getTime() - sdate.getTime()) / 1000 / 
60 / 60 / 24) / 7) * 5) +  odays);}// ########## startMonth 
and endMonth both start at 0 i.e 0 = january, 1 = feb etc
function getDaysMinusWeekend(startDay, startMonth, 
startYear, endDay, endMonth, endYear) {
	var sdate = new Date();
	var edate = new Date();
	var odays = 0;
	var total = 0;

	sdate.setFullYear(startYear,startMonth,startDay);
	edate.setFullYear(endYear,endMonth,endDay);

	odays = 6 - sdate.getDay();
	if(odays == 6) {
		odays = 0;
	}

	sdate.setFullYear(startYear,startMonth,startDay + 
odays);

	return Math.floor(((((edate.getTime() - 
sdate.getTime()) / 1000 / 60 / 60 / 24) / 7) * 5) + 

odays);
}
 
0
Nagaraj
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com