Answered Questions

  • Tricky C Program

    Write a C program to find a peculiar two digit number which is three times the sum of its digits.

    Rajath

    • Aug 5th, 2011

    The only peculiar two digit num is 27..

    Code
    1. #include<stdio.h>
    2. void main()
    3.  
    4.  
    5. {
    6.     int i,j;
    7.     for(i=1;i<9;i++)
    8.     {
    9.         for(j=1;j<9;j++)
    10.         {
    11.             if((10*i)+j==3*(i+j))
    12.             {
    13.                 printf("The value is %d%d",i,j);
    14.                 return;
    15.             }
    16.         }
    17.     }
    18.     return 0;
    19. }
    20.  

  • Pointer Use

    Why do we use pointer instead of variable?

    jbode

    • Sep 30th, 2010

    We *must* use pointers for the following:1. To fake pass-by-reference semantics;2. To track dynamically allocated memory;3. To build self-referential data structures.If we want a function to modify...

    Cmkraj

    • Sep 15th, 2010

    List of pros & cons of pointers over variables1. Fetching speed is faster thru pointers as pointers directly access the memory2. Useful in the concepts of pass by reference. variable value can be chan...

  • Pointer to an Array

    What is pointer to an array? Explain with example.

    jbode

    • Oct 5th, 2010

    For any given data type T, a pointer to an array of T is declared as "T (*arr)[N];".  It has the same value as a pointer to the first element of the array, but a different type (T (*)[N...

  • Recursion

    What is the basic principle behind recursion, other than function calling itself again & again and in which real time scenario we use it?

    jbode

    • Oct 4th, 2010

    The basic idea behind recursion is that you're solving one big problem by breaking it into multiple smaller, easier-to-solve problems.  This can make the algorithm easier to write and un...

  • Use of Static

    What is the use of static in (public static void main string args[])

    Suresh

    • Aug 6th, 2011

    Without creating instance of that class to invoke the main method static keyword is used, by giving the name of the class main method gets invoked.

  • Object Class

    When you declare a class, why does it automatically extends to object class? Give 2 reasons.

  • Bluetooth Modulation Processes

    What kind of modulation processes are adopted in Bluetooth technology?

    khaled

    • Oct 28th, 2011

    The modulation is FSK

  • What is difference between main() and void main()?

    Mehandi kumari

    • Jan 16th, 2018

    Void main() doesnt close all the system which is open during program exacution but int main does.

    Satendra

    • Oct 14th, 2017

    You can also use main() simply that means same as int main()..
    int main() returns an exit value to compiler and works on most compilers.
    And getch() as you mentioned has nothing to do with it. It gets character input on screen or else holds screen in other words

  • Difference between NTFS and FAT32?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Aparna Patil

    • Mar 24th, 2006


    NTFS

    1)allows access local to w2k,w2k3,XP,win NT4 with SP4 & later may get access for somefile.

    2)Maximum size of partition is 2 Terabytes & more.

    3)Maximum File size is upto 16TB.

    4)File & folder Encryption is possible only in NTFS.

    FAT 32

    1)Fat 32 Allows access to win 95,98,win millenium,win2k,xp on local partition.

    2)Maximum size of partition is upto 2 TB.

    3)Maximum File size is upto 4 GB.

    4)File & folder Encryption is not possible.

    nigam

    • Jun 2nd, 2015

    FAT 1.it creats file allocated table. 2.dos support. 3.maximum size 32 gb. 4. convert fat to ntfs without data loss. 5.not support encryption, disk quota, compression. NTFS 1.create main file table. ...

    Prashant

    • Dec 10th, 2014

    You cannot create a FAT32 volume larger than 32 GB

  • Why is transient modifier used and where in real life?

    Many people disturbed me about the solution,some one help me.

    Raja Chaithanya Bangaru

    • Nov 11th, 2005

    In Java, all objects are not serializable.In distibuted environment,an object needs to be serializable.(serialization means writing the state of an object to a file using output stream so that it pers...

  •  What is the difference between declaring a variable and defining a variable?

    Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. You can also initialize a variable at the time it is defined.

    prabhu

    • May 5th, 2007

    Int num;This statement is declaration and also defination since it also allocates memory for variable num.But when you use following statementextern int num;It is only declaration since you are not allocating memory here.

  • What is a const pointer?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Prasad

    • Apr 27th, 2007


    Constant pointer is NOT pointer to constant. Constant pointer means the pointer is constant. For eg:
    Constant Pointer
    int * const ptr2 indicates that? ptr2 is a pointer which is constant. This means that ptr2 cannot be made to point to another integer. However the integer pointed by ptr2 can be changed.



    Where as a Pointer to constant is
    const int * ptr1 indicates that ptr1 is a pointer that points to a constant integer. The integer is constant and cannot be changed. However, the pointer ptr1 can be made to point to some other integer.

  • Array is an lvalue or not?

    An lvalue was defined as an expression to which a value can be assigned. Is an array an expression to which we can assign a value? The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x[5], y[5]; x = y; Additionally, you might want to copy the whole...

    jbode

    • Nov 30th, 2010

     Per the C Language Standard (hoping the posting software doesn't munge the following so that it's completely unreadable): ---------------------6.3.2.1 Lvalues, arrays, and function desig...

  • When is a switch statement better than multiple if statements?

      A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type.

    jaspreet grewal

    • Oct 13th, 2011

    Simply saying, IF-ELSE can have values based on constraints
    where SWITCH can have values based on user choice.