# IBM Coding Questions and Answers 2021 | PrepInsta

## IBM Coding Questions 2021​

### IBM Coding Test is now added as part of the IBM Online Test

Here You can get all the IBM Coding Questions and Answers of IBM Coding Round. Find All the latest 2020 IBM Coding Questions and Test Modules for Coding Round in IBM below. IBM Coding Question 6 questions Total Time 30 minutes Type of Test Non Adaptive Negative Marking No

## IBM Coding Test Questions and Answers 2021

Total Number of Questions:-6 ( 1 Coding Question and 5 MCQ) Total Time Limit:-30 Min    Coding
• C
• C++
• JAVA
• Python
MCQ’s
• DBMS
• Data structure
• Computer Networks

IBM Coding Question Number of Question
Code 1 Question
C MCQ 5 Question

## IBM PROGRAMMING PREVIOUS YEAR  QUESTIONS AND ANSWERS

Here are some questions that are asked in IBM for –

1. IBM C Programming Questions for On Campus
2. IBM Java Programming Questions for On Campus
3. IBM C++ Programming Questions for On Campus

## IBM Coding Prime Material

### IBM MCQ Prime Material ## IBM Coding Questions and Answers

1. Write a program to find HCF of two numbers by without using recursion.

Input format:

The first line contains any 2 positive numbers separated by space.

Output format:

Print the HCF of given two numbers.

Sample Input:

70 15

Sample Output:

5

`#include<stdio.h>int gcd(int,int);int main(){    int m,n,ans;    scanf("%d",&m);    scanf("%d",&n);    while(m!=n)    {        if(m>n)        {            m=m-n;        }        else        {            n=n-m;        }    }    printf("%d",m);    return 0;}`

Q2. Write a  C++ Program to Change Decimal Number to Binary?

`#include <iostream> namespace std; int main()  {    int a, n, i;      cout<<"Enter the number to convert: ";      cin>>n;      for(i=0; n>0; i++)      {        a[i]=n%2;        n= n/2;    }      cout<<"Binary of the given number= ";      for(i=i-1 ;i>=0 ;i--)      {        cout<<a[i];      }    }  `

Q 3.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;  }  `

Q 4. What is the Output of the program

`includeUsing namespace std;int main(){  int a=5,b=10,c=15;  int*arr[]={&a,&b,&c};  cout<<arr;  return 0;}`
• 5
• 10
• 15
• It will print their address of variable b.

Indexing always start from 0 so arr will print second element in the list therefore & stores the addresss of that particular variable so arr[i] will print the address of variable b.

Ans-d

Q 5. What is the Output of the program

`include Using namespace std;int main()    {  Char arr;  int i;  for(i=0;i<10;i++)  *(arr+i)=65 +1;  *(arr+i)=0;  cout<<arr;   return(o); }`
• ABCDEFGHIJ
• AAAAAAAAAA
• JJJJJJJJ
• None of the above
`Solution:-A`

Q 6. What is the Output of the program

`#include Using namespace std;int main(){  char*ptr;  Char Str[]="abcdefg";  ptr=Str;  ptr+=5;  cout<<ptr;  return 0;}`
• fg
• cdef
• defg
• abcd
`Solution:-B`

## Get finely crafted PrepInsta Prime Video to ease your preparation! • 84% of PrepInsta Prime Course students get selected in IBM
• 8 out of 10 fresh grads in IBM are ffrom PrepInsta
• Interview and Resume Preparation is also included in Prime Subscription

## Analyze your prepration with PrepInsta Prime Mock

300+ Topic-Wise Mocks

• Mocks are based on IBM Previous Year Papers
• Detailed analytics and Smart Dashboard ## FAQ

#### Question : What is the Difficulty Level of the Coding Paper of IBM?

Answer: The Coding paper difficulty is Medium to High is IBM Coding Test. If you want to prepare you can Prepare from our website Prepinsta.com

#### Question : In Which Languages You can solve the IBM Coding Test Paper?

Answer: You Can use these langugaes to solve Coding Test of IBM

• C
• C++
• JAVA
• Python

#### Question : How to Prepare for IBM Coding Test Paper?

Answer: You can Visit our website for IBM Coding Test paper.You will get many questions to solve the paper.