# TCS Ninja Exam Advanced Coding Questions

(3 votes)

## TCS Ninja  Coding Section Practice Questions

With less than 2 days left for TCS Ninja, students are pushing beyond their limits in order to prepare for the TCS Ninja Exam. However, students are often confused with the variety and difficulty of questions that might be asked in the exam. This blog contains sample questions related to the Coding Section, which can help students in gaining a general idea about the type and difficulty of questions which can be asked in the exam.

## Q1: Armstrong numbers between two intervals - Write a program to display Armstrong numbers between two intervals.

Input Format:

1. The first line consists of an integer first interval.

2. The second line consists of an integer second interval.

Output Format:

The output is the Armstrong numbers between two intervals with each number on a new line.

Sample Input:

1

1000

Sample Output:

1

153

370

371

407

Practice this question on Programming Hub

## Q2) Convert a Roman number to a decimal number - Write a program to convert a Roman number to a decimal number.

Input format:

Take a Roman number.

Output format:

It will print the decimal number.

Sample input:

XVII

Sample output:

17

Practice this question on Programming Hub

## Q3) Longest Progressive Sequence - Write a program to find the longest progressive sequence arranged in ascending order.

Input Format:

1. The first line contains a length of the sequence

2. The second line contains sequence delimited by white spaces

Output Format:

Longest progressive sequence.

Example :

1 1 2 2 is a progressive sequence but not 1 2 1

Sample Input:

5

1 2 1 2 2

Sample Output:

1 2 2

Practice this question on Programming Hub

## Q4) Sum of the series - Write a program to find the sum of the series:1/1!+2/2!+3/3!+.......1/n!

Input Format:

Takes integer as an input to find the sum of the series up to that range.

Output Format:

The output is the sum of the series.

Sample Input:

5

Sample Output:

2.708333

Practice this question on Programming Hub

## Q5) Remove the given word from a string - Write a program to remove the given word from the input string. If a substring is not present in the input string, then print the input string as it is.

Input Format :

1. The first line consists of the sentence.

2. The second line consists of the words which we want to remove from the given sentence.

Output Format :

Sentence after the given word is removed.

Sample Input :

Conduira is an online learning platform.

learning

Sample Output :

Conduira is an online platform.

Practice this question on Programming Hub

## Check other blogs on TCS Ninja

TCS Ninja Exam Preparation- 10 Day Study Plan

TCS Ninja Recruitment Process

How to Solve TCS Ninja Advanced Coding Questions

TCS Ninja Aptitude Section Pattern

TCS Ninja English Section Pattern

TCS Ninja New Exam Pattern

Read 1545 times Last modified on Monday, 10 September 2018 12:27
Login to post comments

Please key in your e-mail address.

Be up-to-date with the happenings at Conduira!