using conditional operator,find whether the number is completely divisible by 10!can u tell me whether i can learn C-language online by myself!
137113
again really easy:\n\nint divisibility = (m % 10) == 0) ? 1 : 0;\n\nBut I think it is better you learn it yourself. Try a book that would be better. Just search C language tutorials.
405646
There are numerous ways to do that. \nHere is, probably the simplest:\n\nchar *s="char *s=%c%s%c;%cmain() {printf(s,34,s,34,10,10);}%c";\nmain() {printf(s,34,s,34,10,10);}\n\nThe program itself is fairly useless.\nThe whole point of an exercise like this is the satisfaction of finding a solution yourself. Too bad, you did not give yourself a chance
368830
Looks like it's 50 numbers. For example , let the numbers be\n51 thru 100 inclusive. Since even the lowest one can't divide\ninto the highest, none are divisible by the other.  Now lets' suppose there is another number less than 51 in this set. Then\nthat number times 2 will be some number less than or equal to\n100 so by contradiction, there is no other number less than 51\nin the set.
14157
Not sure what LSB and MSB are, but it sounds like from the example that the number is reversed (like 61/16), and the answer should be an integer?\n\n8712 is divisible by 2178, not sure if it's the smallest one, though.
28367
-1 works\n-1*3 + 1 = -2\n-2/2 = -1 (back to where we started)\n\nAddition> Now you say they should be pos! Jeez\n\n0 works though is it technically positive?\n\nWow, try a number like .1  - The numbers get REALLY big before coming back down to 1.  (5.00315450989997E+15)\n\n\n  Function IsOddNum(ByVal intNumber As Double) As Boolean\n    If (intNumber Mod 2 = 0) Then\n      Return False\n    Else\n      Return True\n    End If\n  End Function\n\n  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click\n    Dim num As Double = Convert.ToDouble(TextBox1.Text)\n    Dim count As Integer = 0\n    Literal1.Text = num.ToString() & "<BR>"\n    While num <> 1 And count <> 1000\n      If IsOddNum(num) Then\n        num = 3 * num + 1\n      Else\n        num = num / 2\n      End If\n      Literal1.Text &= num.ToString() & "<BR>"\n      count += 1\n    End While\n  End Sub\n\n\nAnother Note:  I just plotted the number of iterations for the numbers between 1 and 20,000.  The graph totally shows a pattern!  (Mathematicians love patterns)\n\nAnother Note, Doh, now the numbers have to be integers?  Jeez, there goes my repeating number answer.  Are you going to keep adding rules every time I get it right? LOL
14204
yes. it is divisible only by 1 and itself
513403
yes because any number ending in zero is even but is divisable by five
178523
just remeber, if you want to know if any number is divisible by 4 just check to see if the last two digets are divisible by 4... that should greatly help in solving this problem\n\nNow if you would please, stop asking all of your homework questions
366138
I'm assuming you mean *only* the four common operators; as this is a very well known puzzle (called the 24 game, or something similar).\nIn that case, its actually impossible (I have written a computer program to prove this for me). Of course, its possible if you allow various other things like ! or ^, but not with just +-/*.
15662
There are MANY faults in this reasoning.\n\nA) A finite number can only be divisible by integers that are SMALLER than the given number. In the first example, 720 is NOT divisible by 721, 722, etc. In the second example, 1,000,000,000,000,000,000! is not divisible by 1,000,000,000,000,000,000! + 1.\n\nB) A much easier way to find out the factors of a number is to factor it: for example: \n720 = 72 x 100 = 9 x 8 x 10 = 3x3 x 2x2x2 x 2x5, then you can use a method in combinatorics to find out how many different numbers you can make by multiplying the factors of 720 in different ways to see how many different numbers go into 720.\n\nC) Combining arguments A and B, you CAN show that 1,000,000,000,000,000,000! IS divisible by all integers smaller than 1,000,000,000,000,000,000. (I do intend to leave out "!")\n\nD) Finally, and most importantly, if you are going to show something is true for all integers you must either sit down for all time testing the validity of your hypotheses on EVERY NUMBER or you can use Mathematical induction.\n\nInduction means that you show your hypothesis is true for some initial number n (e.g. show that 720 is divisible by 1). Then you must show that IF your hypothesis is true for any n, THEN it must be true for the next number, n+1. You must carry out this argument WITHOUT REPLACING n WITH A NUMBER!\nYou should try to prove that1,000,000,000,000,000,000! is divisible by all positive integers smaller than 1,000,000,000,000,000,000 by showing if it's true for n, then it's true for n-1.
519596
None, because 100 isn't divisible by 3
147389
you search for a common factor, 2s,3s,5s and 10s are the most apparent. Once you look to a number you can immediately decide if it is divisible by 2 ( if the number is even) or by 3 (if the total of the digits is divisble by 3 i.e 168 total = 15 divisible by 3), or by 5 ( the last digit is 0 or 5) or divisble by 10 ( the last digit is 0).. good luck
500867
Test for divisible by 2 - last digit is 0, 2, 4, 6, 8\nTest for divisible by 4 - last *two* digits are divisible by 4\nTest for divisible by 5 - last digit is 0 or 5\nTest for divisible by 6 - divisible by 2 and sum of digits is a multiple of 3).\nTest for divisible by 9 - sum of digits is a multiple of 9\nTest for divisible by 10 - last digit is 0.\n\nIf you check 1800, you'll see that it passes ALL tests.
374969
Let the number be X\nThen X = 1000a + 100b + 10c + d, where a,b,c,d are the digits of X.\nLet the 'flipped' number be Y.\nThen Y = 1000d + 100c + 10b + a\nSo, X - Y = 1000a + 100b + 10c + d - (1000d + 100c + 10b + a)\nor\nX - Y = 999a + 90b - 90c - 999d\n= 9 * (111a + 10b - 10c - 111d) .\nwhich is divisible by 9.\nThe sum of the digits of any number divisible by 9 is itself divisible by 9.*  So if you sum the digits of X-Y, you will get a number divisible by 9.  Then if you sum the digits of that number, you will get another (smaller) number divisible by 9.  If you keep doing that, you will eventually get to 9. [I assume that's what you meant.  If you sum the digits just once you wont necessarily get 9, as in your example. 6354-4536 = 1818 which sums to 18.]\n\n* You can prove that the sum of the digits of any number divisible by 9 is itself divisible by 9 by induction.\nThe first 2-digit multiple of 9 is 18, and 1+8 = 9.\nAssume it is true for k*9 where k is a natural number (1,2,3,...)\nProof for (k+1)*9:\n(k+1)*9 = k*9 + 9\nIf the last digit of k*9 is 0, then adding 9 just adds 9 to the sum of the digits of k*9.  Since the sum of the digits of k*9 is divisible by 9, so is this sum + 9.  We are done.\nIf the last digit is anything else and the tens digit is <9, adding 9 is the same as adding 1 to the tens digit and subtracting one from the one's digit.  So the sum is the same as the sum of k*9 + 1 - 1 = k*9 and we are done\nIf the last digit is anything else and the tens digit=9 then adding 1 to the tens digit means subtracting 9 from the tens digit and adding 1 to the hundred digit, which means the sum is the same as the sum of k*9 + 1 - 9 + 1 = the sum of k*9 - 9 which is divisible by 9.  (This can be extended to carrying a 1 to the other places as well.)
35727
I'll take it as far as I can.\n\n3 - Add all the numbers and if the result is divisible by 3 then the entire number is 9+1+2+0+3+1+2=18 which is divisible by 3.\n4 - The last 2 numbers are divisible by 4. 12 is divisible by 4 so the entire number is.\n6 - It's divisible by 2 and 3.\n8 - If the last 3 numbers are divisible by 8, then the entire number is. 312/8=39. \n9 - Like for 3, except it has to be divisible by 9. The result, from above, is 18 which is divisible by 9.\n12 - If divisible by 3 and 4.\n18 - If divisible by 2 and 9.\n24 - If divisible by 8 and 3.\n36 - If divisible by 4 and 9.\n72 - If divisible by 8 and 9.
391750
Since ABC divided by 5 and by 6 are both integers and that 5 and 6 are relatively prime, it follows that ABC is divisible by 30, so C is 0.\n\nBy the division, DE and ED are integers with DE the larger and divisible by 6 and ED the smaller and divisible by 5.  Also we can deduce that DE = (6/5)*ED.\n\nSince ED is divisible by 5, then D is either 0 or 5, but if it were 0, then DE would be a one digit number and less than ED.  So D must be 5.\n\nSo we are looking for a single digit E so that 5E = (6/5)*E5, and that 5E > E5.  Since we only have 1, 2, 3, and 4 as our candidates (0 is right out by a similar one digit number argument as above).  We can check each case to find that E=4.\n\nSo ABC = 6*ED = 6*45 = 270.  Thus the numbers are\n\nA = 2\nB = 7\nC = 0\nD = 5\nE = 4.\n\nCheers!
546297
hi,\ndo loop is first excecute the task and then its check the condition.\n\ntime 1:\n---------\nd=0, i=20.\n\nd=d+(1.0/i)\nd=0+(1.0/20)\nso new d=0.05\n\nand at the same time,\ni=i/(-2)\nso new i=20/(-2)\nnew i=(-10)\n\nnow the d=0.05\nand i=(-10)\n\nand then its check the condition.\ni<5\n(-10) < 5 is true\nso it wil run the loop again,\n\nso nw come to the 2nd level...\n\nTime 2:\n----------\nd=d+(1.0/i)\nso d=0.05+ (1.0 /(-10)\nnew d =0.05+ (-0.1)\nnew d=0.05-0.1\nd= (-0.05)\n\nand concider abt i,\ni=i/(-2)\ni=(-10)/(-2)\nso new i = (+5)\n\nnow lets checks the condition,\ni < 5\n+5 < 5 is fals, \nso the program s terminated.\n\nso now the value of d= (-0.05)\n\nr u clear?\nthis is a gud egsample for tha do while loop,\nHav fun bro,\ntc.