Knowledge is Power.

  • Who you are ?

    Working on machines without understanding them ? Then you should be here..

  • Where you are ?

    Geographical location should not become a barrier to Share our knowledge.

  • What do you do ?

    Puzzles and Interview question are intended to be discussed here.

    Wednesday, February 24, 2010

    Q 11.)
    Is there a way to multiply two matrix in less than O(n^3) time complexity..

    For this Q algorithm was asked, if you guys don't know the answer then make a comment below and I will tell the answer or just take some efforts to search it.



    Q 12.)

    #include
    using namespace std;

    int main()
    {
    int a,c,foo;
    char *p;
    cin>>a>>c;// give two numbers..

    p=(char *)a;
    foo= (int)&p[c];
    cout<return 0;
    }

    what this code snippet does...
    even if u get the answer explain the logic.
    without executing




    Q 13.)

    whats wrong with this program..

    #include
    using namespace std;

    class foo
    {
    const int a;
    public:
    foo():a(10)
    {}

    void show()
    {
    cout<}
    };

    int main()
    {
    const foo obj;
    obj.show();
    }



    Q 14.)

    #include
    using namespace std;

    int main()
    {
    int *p,*c;
    p=(int*)10;
    c=(int*)20;
    cout<<(int)p<<(int)c;
    }

    is this a valid program..
    if no why..
    if yes why..




    Q 15.) #include
    using namespace std;

    int main()
    {
    void *vptr = malloc(sizeof(int)*2);
    int p;
    p=(int)vptr;
    *((int*)p +0)=9;
    *((int*)p +1)=10;
    cout<<1[(int*)vptr]; }

    comment on this program and write the output if any

    0 comments:

    Post a Comment