.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » IBM Placement Papers » IBM Previous Year Placement Paper

 

IBM Placement Paper - C/C++ and APTITUDE TEST Question And Answers


Advertisements
Advertisements




IBM Previous Years Solved Sample Placement Papers

  1. Output of the following program is:
    main()
    {
        int i = 0;
        for(i = 0; i < 20; i++)
        {
            switch(i)
            case 0: i += 5;
            case 1: i += 2;
            case 5: i += 5;
            default: i += 4;
            break;
        }
        printf("%d,", i);
    }
            

    (a) 0,5,9,13,17

    (b) 5,9,13,17

    (c) 12,17,22

    (d) 16,21 (Ans)

    (e) Syntax error

  2. What is the output of the following program:
    main()
    {
        char c = -64;
        int i = -32;
        unsigned int u = -16;
        if(c > i)
        {
            printf("pass1,");
            if(c) printf("pass2");
            else printf("Fail2");
        }
        else printf("Fail1");
        if(i) printf("pass2");
        else printf("Fail2");
    }
            

    (a) Pass1,Pass2

    (b) Pass1,Fail2

    (c) Fail1,Pass2 (Ans)

    (d) Fail1,Fail2

    (e) None of these

  3. In the process table entry for the kernel process, the process ID value is:

    (a) 0 (Ans)

    (b) 1

    (c) 2

    (d) 255

    (e) It does not have a process table entry

  4. Which of the following API is used to hide a window?

    (a) ShowWindow (Ans)

    (b) EnableWindow

    (c) MoveWindow

    (d) SetWindowPlacement

    (e) None of the above

  5. What will the following program do?
    void main()
    {
        int i;
        char a[] = "String";
        char *p = "New String";
        char *Temp;
        Temp = a;
        a = malloc(strlen(p) + 1);
        strcpy(a, p); // Line number: 9
        p = malloc(strlen(Temp) + 1);
        strcpy(p, Temp);
        printf("(%s, %s)", a, p);
        free(p);
        free(a);
    } // Line number 15
            

    (a) Swap contents of p & a and print: (New string, string)

    (b) Generate compilation error in line number 8 (Ans)

    (c) Generate compilation error in line number 5

    (d) Generate compilation error in line number 7

    (e) Generate compilation error in line number 1

  6. In the following code segment, what will be the result of the function?
    Value of x , value of y
    {
        unsigned int x = -1;
        int y;
        y = ~0;
        if(x == y)
            printf("same");
        else
            printf("not same");
    }
            

    (a) same, MAXINT, -1 (Ans)

    (b) not same, MAXINT, -MAXINT

    (c) same, MAXUNIT, -1

    (d) same, MAXUNIT, MAXUNIT

    (e) not same, MAXINT, MAXUNIT

  7. What will be the result of the following program?
    char *gxxx()
    {
        static char xxx[1024];
        return xxx;
    }
    
    main()
    {
        char *g = "string";
        strcpy(gxxx(), g);
        g = gxxx();
        strcpy(g, "oldstring");
        printf("The string is : %s", gxxx());
    }
            

    (a) The string is : string

    (b) The string is : Oldstring (Ans)

    (c) Run time error/Core dump

    (d) Syntax error during compilation

    (e) None of these




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy