# IBM Coding Questions and Answers

## IBM Coding Questions 2020

### 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.  In IBM Coding Test Paper there will be 1 Coding Question and 5 MCQs. There will be Coding Questions from:-
• C
• C++
• JAVA
• Python IBM Coding Question 6 questions Total Time 30 minutes Type of Test Non Adaptive Negative Marking No

### IBM Coding Test Questions and Answers

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 Paid Material

### IBM MCQ Paid Material ### IBM Paid Material Latest 2020 (UPDATED with Latest Pattern)

Old Pattern (NOT Asked in Cognify Exam)

New Pattern (Asked in Cognify Test)

### Online Classes

1. Free Paid Materials also given

## 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?

1. #include
2. using namespace std;
3. int main()
4. {
5. int a, n, i;
6. cout<<“Enter the number to convert: “;
7. cin>>n;
8. for(i=0; n>0; i++)
9. {
10. a[i]=n%2;
11. n= n/2;
12. }
13. cout<<“Binary of the given number= “;
14. for(i=i-1 ;i>=0 ;i–)
15. {
16. cout<<a[i];
17. }
18. }

Q 3.C++ Program to generate Fibonacci Triangle

1. #include <iostream>

2. using namespace std;

3. int main()

4. {

5.   int a=0,b=1,i,c,n,j;

6.     cout<<“Enter the limit: “;

7.     cin>>n;

8.     for(i=1; i<=n; i++)

9.     {

10.         a=0;

11.         b=1;

12.         cout<<b<<“\t”;

13.         for(j=1; j<i; j++)

14.         {

15.             c=a+b;

16.           cout<<c<<“\t”;

17.             a=b;

18.             b=c;

19.         }

20.         cout<<“\n”;

21.     }

22. return 0;

23. }

Q 4. What is the Output of the program

include<iostream>

Using 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 <iostream>

Using namespace std;

int main()

{

char*ptr;

Char Str[]=”abcdefg”;

ptr=Str;

ptr+=5;

cout<<ptr;

return 0;

}

• fg
• cdef
• defg
• abcd

Solution:-B

## IBM Coding Questions andAnswers 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.

Summary Review Date
Reviewed Item
5     