.
  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 - Programming Question And Answers


Advertisements
Advertisements




IBM Previous Years Solved Sample Placement Papers

1. Reverse a String in Java

import java.io.*;
import java.util.Scanner;

class PrepBytes {
    public static void main (String[] args) {    
        String str = "PrepBytes", nstr = "";
        char ch;    
        System.out.print("Original word: ");
        System.out.println("PrepBytes");    
        for (int i = 0; i < str.length(); i++) {
            ch = str.charAt(i); 
            nstr = ch + nstr;
        }
        System.out.println("Reversed word: " + nstr);
    }
}
    

2. C Program to Find the Largest Number Among Three Numbers

#include 

int main() {
    int A, B, C;
    printf("Enter the numbers A, B and C: ");
    scanf("%d %d %d", &A, &B, &C);
    
    if (A >= B && A >= C)
        printf("%d is the largest number.\n", A);
    if (B >= A && B >= C)
        printf("%d is the largest number.\n", B);
    if (C >= A && C >= B)
        printf("%d is the largest number.\n", C);
    
    return 0;
}
    

3. Compute Average of Two Numbers Without Overflow (C++)

#include 
using namespace std;

int compute_average(int a, int b) {
    return (a + b) / 2;
} 

int main() {
    int a = INT_MAX, b = INT_MAX;
    cout << "Actual average: " << INT_MAX << endl;
    cout << "Computed average: " << compute_average(a, b) << endl;
    return 0;
}
    

4. Check if a Given Number is Prime or Not (C++)

#include 
using namespace std;  

bool isPrime(int n) {
    if (n <= 1)
        return false;

    for (int i = 2; i <= sqrt(n); i++)
        if (n % i == 0)
            return false;

    return true;
}

int main() {
    isPrime(11) ? cout << "true\n" : cout << "false\n";
    return 0;
}
    

5. C++ Program to Generate Fibonacci Triangle

#include
using namespace std;  

int main() {  
    int a = 0, b = 1, i, c, n, j;    
    cout << "Enter the limit: ";   
    cin >> n;    
    for(i = 1; i <= n; i++) {    
        a = 0;    
        b = 1;    
        cout << b << "\t";   
        for(j = 1; j < i; j++) {    
            c = a + b;    
            cout << c << "\t";    
            a = b;    
            b = c;  
        }    
        cout << "\n";    
    }  
    return 0;  
}  
    




 


.

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