Home / General Knowledge / Testing sawaal :: Programming Section 1

General Knowledge :: Testing sawaal

  1. What is the output of this C code?

            #include <stdio.h>
            void main()
            {
                int x = 97;
                char y = x;
                printf("%cn", y);
            }

  2. A.
    a
    B.
    97
    C.
    Run time error
    D.
    None

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What would be the output of the following program ?

    main() 

    {

           unsigned  int a = oxffff;

            ~a;

            printf ("%x", a);

    }

  4. A.
    ffff
    B.
    0000
    C.
    00ff
    D.
    None of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. void main()

    {

    char good *better, *best;

    printf( "%d..%d", sizeof(better), sizeof(best) );

    }

  6. A.
    1..2
    B.
    4..4
    C.
    4..2
    D.
    2..2

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What will be output when you will execute following c code?

    #include <stdio.h>
    enum actor

    {
        SeanPenn=5,
        AlPacino=-2,
        GaryOldman,
        EdNorton
    };
    void main()

    {
         enum actor a=0;
         switch(a)

          {
             case SeanPenn:  printf("Kevin Spacey");
                             break;
             case AlPacino:  printf("Paul Giamatti");
                             break;
             case GaryOldman:printf("Donald Shuterland");
                             break;
             case EdNorton:  printf("Johnny Depp");
          } 
    }

  8. A.
    Kevin Spacey
    B.
    Paul Giamatti
    C.
    Donald Shuterland
    D.
    Johnny Depp

    View Answer

    Workspace

    Discuss Discuss in Forum


  9.  What is the output of this C code? 

            #include <stdio.h>
            void m()
            {
                printf("hi");
            }
            void main()
            {
                m();
            }

  10. A.
    hi
    B.
    Run time error
    C.
    None
    D.
    Varies

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. What is the output of this C code?

            #include <stdio.h>
            void main()
            {
                int y = 3;
                int x = 5 % 2 * 3 / 2;
                printf("Value of x is %d", x);
            }

  12. A.
    Value of x is 1
    B.
    Value of x is 2
    C.
    Value of x is 3
    D.
    Compile time error

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. A source program is the program written in which level language  ?

  14. A.
    Alpha Numeric
    B.
    High-Level
    C.
    Symbolic
    D.
    Machine

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Macro flowchart is also called as

  16. A.
    Less Detail flowchart
    B.
    More detail flowchart
    C.
    Simple detailed flowchart
    D.
    None of the above

    View Answer

    Workspace

    Discuss Discuss in Forum