GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  Programming  >  C

 Print  |  
Question:  Q1. write a program to find a given number is armstrong number or not ?

Q2write a program which accepts a filename as a command line argument and reverse the contents of the file(i.e first character becomes the last character of the file and so on ?

Q3 how can i call a function given its name as a string ?

Q4 How to swap low-order byte and high order byte in an integer without using temporary variable?

Q5 If we develop a project in C, then how can we create an .exe file of it?

Q6 how to print 1 to 100 numbers without using any condition checkings ?


Answer: please let me know the answers to my email address as i having the interview in TCS so please please please please let me know


January 01, 2007 02:43:28 #4
 malaram   Member Since: January 2007    Total Comments: 6 

RE: Q1. write a program to find a given number is arms...
 
Armstrong number is a number that in a given base is the sum of its own digits to the power of the number of digits.For example:1³ + 5³ + 3³ = 153 To put it algebraically, let be an integer with representation dkdk − 1...d1 in base-b notation. If for some m it happens that then n is a narcissistic number (or an m-narcissistic number).In "A Mathematician's Apology", G. H. Hardy wrote:"There are just four numbers, after unity, which are the sums of the cubes of their digits:153 = 13 + 53 + 33370 = 33 + 73 + 03371 = 33 + 73 + 13and 407 = 43 + 03 + 73. These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to the mathematician."However, it is not known if the only base 10 numbers equal to the sum of the cubes of their digits are 1, 153, 370, 371, and 407.Some "base ten" Armstrong numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, ... (sequence A005188 in OEIS)Some "base three" Armstrong numbers are: 0,1,2,12,122Some "base four" Armstrong numbers are: 0,1,2,3,313
     

 

Back To Question