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


May 05, 2008 11:37:05 #9
 banele   Member Since: May 2008    Total Comments: 1 

RE: 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
 
  1. import java.util*.;
  2. public class armstrong number
  3.     {
  4.        public static void main(strings args);
  5.        {
  6.         keyboard scanner = new key board scanner;
  7.         screen wirter = new screen writer;
  8.         int kb writer.next=new kb writer
  9.          {
  10.          int counter =0;
  11.          int sum;
  12.          }       
  13.          system.out.println(please Enter a number);
  14.          }
  15.           whilecounter(i<=o;i++);
  16.         {
  17.          for (i=no;&&no^;i++)
  18.            {
  19.            if (no^base++sum)
  20.             system.out.println(sum+"number is an  armstrong number");
  21.             else
  22.             system.out.println(sum+"number is not an armtrong number");
  23.           }
  24.       }
  25.   }
     

 

Back To Question