Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer

image
image

Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer a country he must know about his enemy's boundary limits. Help him to find his enemy's boundary limits by writing a java program. Input format Integer: No of enemy country(N) N Integer corresponds to no. of villages in each country (M). M Integers corresponds to ID of each villages. Output format Integer output corresponds to ID of each village located at the boundary of each enemy's country. Sample testcases Input 1 4 4 2 1 6 12 66 78 10 10 2 100 123456 Output 1 12 10 10 2 Report Error 100 16 Note: The program will not be evaluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing Q-1 Single File Programming Question Sum of the asked digits Input format Write a java program to calculate the sum of every ith digit in the given number. The input consists of a single integer 'n' which corresponds to the given number. Set of digits to be considered for calculating the sum will be provided as space separated integer values. Refer the sample input and output for more explanation. Long n Integer k Space separated k integers Code constraints 0 < Number of digits in the given number n < 10000 Sample testcases Input 1 1234567890 2 2.3 Output 1 32 Report Error Marks: 20 Negative Marks : 0 Note: The program will not be aluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

=+6 Why is there no term for Q4?

Answered: 1 week ago