[Solved] I want to check if sq. root of a number is int

Do something like below : double a = 5, b = 25; short count = 0; for (double i = a; i <= b; i++) { double sqrut=sqrt(i); if ((int)(sqrut) == sqrut) { printf(“Perfect square %.0f found\n”, i); count++; } } printf(“Total number of perfect squares is %d\n”, count); or like below : double a … Read more

[Solved] Java static instance

This code reminds me of Singleton Class in java. public class Runa { private static Runa singleton = new Runa( ); /* A private Constructor prevents any other * class from instantiating. */ private Runa() { } /* Static ‘instance’ method */ public static Runa getInstance( ) { return singleton; } /* Other methods protected … Read more

[Solved] What’s the difference between following two scripts written in JavaScript? [closed]

Instead of submit, try using input type button… <input type=”button” class=”btn btn-primary” name=”submit” id=”submit” value=”Back” onclick=”javascript:window.location=”https://stackoverflow.com/questions/23087236/login.php”” /> solved What’s the difference between following two scripts written in JavaScript? [closed]

[Solved] Converting number to word

First of all take hundreds place digit by deviding by 100 and print corresponding number by calling method numberToWord((number / 100), ” HUNDRED”); since number / 100 would be in between 0 to 9 so it will print digit in word concatenated by HUNDRED. Now you left with two digit number for that you directly … Read more

[Solved] how to echo an onlick function in php [closed]

Try this foreach($people as $row){ echo “<form action=”https://stackoverflow.com/questions/23799703/.base_url().”some_controller/hideSingleApp_idx method=post>”; echo “<td>”.$row->description.”</td>”; echo “<td><input type=image src=”https://stackoverflow.com/questions/23799703/.base_url().”hidebutton_white.png height=17 width=17 onclick=’return confirm(\”You sure nigga?\”)’/><br></td></form>”; 1 solved how to echo an onlick function in php [closed]

[Solved] How to save data in mysql from cookies in php? [duplicate]

Your question is not clear, but it may be useful to you. You can iterate over php cookie array and insert it in your table. foreach($_COOKIE as $name => $cookie){ // you can check any conditions based on cookie name $name $query1 = “INSERT INTO table_name(field_name) VALUES(” . mysql_escape_string($cookie) . “)”; mysql_query($query1); unset($query1); } 3 … Read more

[Solved] compare first word of a string array with a string in c

strtok is ok for this and you should do something like: #include <string.h> int i = 0; char *token; int different; while(i < size){ token = strtok(array[i], ” “); different = strcmp(word, token); if(different){ //do something } i++; } 3 solved compare first word of a string array with a string in c

[Solved] I have been stuck on this homework: [closed]

Here’s one way to do it – using nested functions: (function(){ (function(){ return arguments[1]<11?arguments.callee( arguments[0],arguments[1]+1,arguments[2]+’ ‘+ (arguments[1]+arguments[0]*10)):console.log(arguments[2]); }(arguments[0],1,”)); return arguments[0]<9?arguments.callee(arguments[0]+1):0; }(0)); See demo on jsbin. It will give you extra points for using closures, recursion, immediately invoked function expressions, and not using global variables – thus not polluting the namespace. If you carefully follow the … Read more