Thursday, March 7, 2019

Zoho Coding Questions

Step Number:-
Given a number N, the program must print if N is a step number or not. (A step number is a number which
has a digit which is either 1 more or 1 less than the previous digit).
Input Format:
The first line contains N.
Output Format:
The first line contains yes or no
Boundary Conditions:
10 <= N <= 99999999
Example lnput/Output 1:
Input:
1212343
Output:
yes
Example lnput/Output 2:



Input:
342345
Output:
no
Explanation:
The difference between 2 and 4 is NOT 1






















Array LEADERS (2H)
An array of N numbers is passed as input. The program must print all the LEADERS in the array.A number is a LEADER if it is greater than all the numbers to it's right.
Note: The rightmost number is always a leader.
Input Format:
The first line contains N numbers. each separated by a space.
Output Format:
The first line contains the LEADERS, each separated by a space.
Boundary Conditions:
1 <= N <= 9999
Example lnput/Output 1:
Input:
10 17 4 3 5 2
Output:
17 5 2





















Print 1to N - Digits Count [ZOHO]
A positive integer N is passed as the input. If we print all the numbers from 1 to N continuosly, the program must find the number of characters(dig1‘ts) C printed and print the count C as the output-
Input Format:
The first line contains N.
Output Format:
The first line contains C.
Boundary Conditions:
1 <= N <= 9999999
Example Input/Output 1:
Input:
2
Output:
2
Explanation:
We print 12 and hence the total number of characters is 2.
Example lnput/Output 2:
Input:
15


















Pattern Printing ~ Numbers [ZOHO]
Based on the input value of N. the program must print the pattern described below.
Input Format:
First line will contain the value of N-
Output Format:
N lines will contain the number pattern as described below with each value separated by a single space.
Boundary Conditions:
1 <= N <= 50
Example lnput/Output 1:
Input:
5
Output:
1 6 10 13 15
2 7 11 14
3 8 12
4 9
5

















String- ReverseWords [ZOHO]
A strings is passed as the input. The program must reverse the order of the words in the string and print them as the output.
Input Format:
The first line will contain 5.
Output Format:
The first line will contain the words in the strings in the reverse order.
Boundary Conditions:
Length of S is from 5 to 100.
Example lnput/Output 1:
Input:
Today is Friday
Output:
Friday is Today
Example lnput/Output 2:
Input:
five six ten eleven
Output:
eleven ten six five

3 comments:

  1. xn--o80b910a26eepc81il5g.online - Online casino online
    yd n--Odd is on a クイーンカジノ casino website. You're not logged william hill in. Please Login or Sign 우리카지노 쿠폰 In.

    ReplyDelete
  2. What does a casino do? - TrickTactoe
    A casino is a casino in which players choose to play for real 사설토토 중독 샤오미 money. The casino is considered one of 바카라 검증사이트 the most 토토 꽁 머니 popular e 스포츠 things to 빌리버 do in America.

    ReplyDelete
  3. Slingo Originals | The King of Dealer
    Slingo Originals is an online gambling site established 카지노 사이트 in 2011. It primarily offers bingo and casino games, and also slots and kirill-kondrashin table games

    ReplyDelete

Zoho Coding Questions

Step Number:- Given a number N, the program must print if N is a step number or not. (A step number is a number which has a digit which is ...