Programming Tagged Questions | Programming Related Questions | Programming Based Interview Questions- anyforum.in
http://www.anyforum.in/tag/programming
It contains all queries and interview questions based on computer programming.What will be the output of the following program?
http://www.anyforum.in/question/programming/basics/What-will-be-the-output-of-the-following-program/859
Bitwise OR and Logical OR operator Example.Program for triangle pattern
http://www.anyforum.in/question/corejava/programming/Program-for-triangle-pattern/855
Program for triangle pattern.Evil Number
http://www.anyforum.in/question/corejava/programming/Evil-Number/853
An Evil number is a positive whole number which has even number of 1's in its binary equivalent. Design a program to accept a positive whole number and find the binary equivalent of the number and count the number of 1's in it and display whether it is an Evil number or not with an appropriate message.Strange Number Range
http://www.anyforum.in/question/corejava/programming/Strange-Number-Range/851
A positive whole number N that has D number of digits is squared and split into two pieces, a right-hand piece that has D digits and a left-hand piece that has remaining D or D-1 digits. If the sum of the two pieces is equal to the number, then N is a Strange number. Farenheit and Celcius
http://www.anyforum.in/question/programming/basics/Farenheit-and-Celcius/848
It is required to calculate the Fahrenheit equivalent of 49 degree celcius. Use the following steps to write the program a) Declare two double variables fahr and celcius b) Assign the value of 49.0 to celcius c) multiply celcius by 9, divide by 5 and then add 32 to it d) Assign the above evaluation expression to the variable fahr e) Print the value of fahr.Age Difference
http://www.anyforum.in/question/corejava/programming/Age-Difference/846
Given the age of 10 couples(husband and wife), print Number of years of age difference for all the 10 people.Check the temperature
http://www.anyforum.in/question/programming/basics/Check-the-temperature/844
Given two temperatures, print ´true´ if one is less than 0 and the other is greater than 100. Else print ´false´.Bank of Ignite ATM
http://www.anyforum.in/question/corejava/programming/Bank-of-Ignite-ATM/842
You would like to withdraw Rs. X from an ATM. The ATM stores only Rs. 100 notes and thus accepts the transaction if X is a multiple of 100. Ofcourse, your account balance must have enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges Rs. 5. Calculate your account balance after an attempted transaction. Java Program to calculate Circle area
http://www.anyforum.in/question/corejava/programming/Java-Program-to-calculate-Circle-area/841
Calculate area of circle with radius 20 using predefined value of PI. (Use Math.PI) and print the area.Happy number
http://www.anyforum.in/question/corejava/programming/Happy-number/840
A happy number is a number in which the eventual sum of the square of the digits of the number is equal to 1.Game of bus-bus
http://www.anyforum.in/question/corejava/programming/Game-of-bus-bus/833
The game of bus-bus is played by a set of people, who form a circle. One of the persons in the circle has to say ´one´, the next person should say ´two´ and so on. Whenever a person gets a number, which is either divisible by seven or ends with seven, he, she should say ´Bus´ instead of the number. If the number in turn is both visible by seven and ends with a seven, then ´BusBus´ should be uttered. Any one who violates the rule is taken out of the circle and the game continues with the remaining persons. The last one remaining is the winner of the game. Write a program to simulate this game. Input to your program is n upto which the above rule should be followed. Check whether a given number is teen or not?
http://www.anyforum.in/question/corejava/programming/Check-whether-a-given-number-is-teen-or-not/831
We´ll say that a number is "teen" if it is in the range 13 to 19 inclusive. Given 2 integer values, print the number that is the teen range. Sample Input: 12 14 Sample Output: 12 and 14 both are teen numbers Sample Input: 21 25 Sample Output: 21 and 25 both are not teen numbers Sample Input: 17 89 Sample Output: 17 is a teen number Template: import java.util.*; public class Program3 { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); //Write your code here } } Same or Not
http://www.anyforum.in/question/corejava/programming/Same-or-Not/830
Take two positive integer values from the user, print their sum, unless the two values are the same, then print double of their product.Java Program for Caesar Cipher Encryption
http://www.anyforum.in/question/corejava/programming/Java-Program-for-Caesar-Cipher-Encryption/828
In cryptography, a Caesar cipher, also known as the shift cipher. It is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plain text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 3, A would be replaced by D, B would become E, X would replace by A and so on. Write a JAVA program to implement Caesar cipher Algorithm. Input Specification: First line will contain an integer 1 or 2.(1 means encryption and 2 means Decryption) Second line will contain a key N. Third line will contain a string(a single word containing only Alphabets) which is either to be encrypted or decrypted based on user input on line 1. Output Specification: Contains a single line encrypted or decrypted String. Sample Input: 1 3 Ignite Sample Output. Ljqlwh Sample Input: 2 3 Ljqlwh Sample Output. Ignite Java Program for Stretch Factor
http://www.anyforum.in/question/corejava/programming/Java-Program-for-Stretch-Factor/827
write a Java Program that accepts Stringa and an integer stretch factor P as parameters and that replaces each element with k copies of that element. For example, if a variable called list stores the elements [hi, how, are, you?], then the call of stretch(list, 3); it will store [hi, hi, hi, how,how,how,are,are,are, you?, you?, you?]. If a stretch factor of 0 or less is passed, the list is made empty. In this case, print "EMPTY" You can assume that the input list will never be empty. Sample input: 3 hi how are you? sample output: hi hi hi how how how are are are you? you? You?find nearest factorial
http://www.anyforum.in/question/corejava/programming/find-nearest-factorial/826
Write a program to find the nearest factorial. The program takes an integer as an input and has to find a number which is nearest to it which is a factorial of another number.Java Program-Staying In a Hotel
http://www.anyforum.in/question/corejava/programming/Java-Program-Staying-In-a-Hotel/825
There is a school trip being organized for kids. The hotel the group is staying in can offer them one big room with enough beds to suit any group of visitors, and several smaller rooms with B beds all together. The children have heard many strange and frightening stories about the big room. That´s why not even one of them wants to sleep in the big room. Furthermore not every kid would like to sleep in any bed. Your goal is to assign B beds from the smaller rooms in such a way that the maximal number of children are happy (a child is happy when it gets to sleep in one of the beds it has selected). Java Program-TollBooth
http://www.anyforum.in/question/corejava/programming/Java-Program-TollBooth/824
Imagine a tollbooth at a bridge. Cars passing by the bridge are expected to pay a 50 rupees toll. Mostly they do, but sometimes a car goes by without paying. The tollbooth keeps track of the number of cars that have gone by, and of the total amount of money collected. Write a program to allow the user to press the key 1 to count a paying car, and 2 to count a nonpaying car. Pressing any other key should cause the program to print the output (as defined in Output format section) and then exit from the program. Output format: The output consists of 4 lines. First line of the output contains an integer which corresponds to the total number of cars. Second line of the output contains an integer which corresponds to total number of cars who paid. Third line of the output contains an integer which corresponds to total number of cars who have not paid Fourth line contains an integer which corresponds to the total amount of money collected in rupees. Java Program-Zero Max
http://www.anyforum.in/question/corejava/programming/Java-Program-Zero-Max/823
Write a program to rearrange the given array where each zero value in the array is replaced by the largest odd value to the right of the zero in the array. If there is no odd value to the right of the zero, leave the zero as a zero Input Specification line 1 array size line 2 array elements Output Specification line 1 Rearranged array Input: 4 0 5 0 3 Output: 5 5 3 3.WAP to check an ISBN Number
http://www.anyforum.in/question/corejava/programming/WAP-to-check-an-ISBN-Number/819
An ISBN (International Standard Book Number) is a ten digit code which uniquely identifies a book. The first nine digits represent the Group, Publisher and Title of the book and the last digit is used to check whether ISBN is correct or not. Each of the first nine digits of the code can take a value between 0 and 9. Sometimes it is necessary to make the last digit equal to ten; this is done by writing the last digit of the code as X. To verify an ISBN, calculate 10 times the first digit, plus 9 times the second digit, plus 8 times the third and so on until we add 1 time the last digit. If the final number leaves no remainder when divided by 11, the code is a valid ISBN. Mystery Temple
http://www.anyforum.in/question/corejava/programming/Mystery-Temple/815
There is a mysterious temple in Ignite. The door of the temple is always closed. It can only be opened by a unique procedure. There are two boxes and N items outside the temple. Srini visits the temple many times. Each time Srini visits the temple, the number of items N outside the door of the temple is changed but each time he anyhow manages to know the cost of those N items. The door of the temple can only be opened if those "N items" are distributed in those two boxes such that the sum of cost of items in one box is equal to the sum of cost of items in other box. Srini is trying to do such a distribution so as to open the door of the temple. You have to help him with the distribution so as to open the door of the temple. String split
http://www.anyforum.in/question/corejava/string-handling/String-split/814
Write a java program that takes a line of text as input, which consists of several words separated by "+" and prints the words in input text in reverse order. Sample Input : This+is+a+very+simple+sentence, Sample Output : sentence simple very a is this.Soumya and his Food Coupon
http://www.anyforum.in/question/corejava/programming/Soumya-and-his-Food-Coupon/811
A shop advertises that all customers buying three items with the second item priced as an even number will get a discount provided the total purchase is at least for Rs. 1000. Given three price values, your program should output: Discount available for 403 500 99 or Discount not available for 403 500 99. Soumya has a bad habit of losing his Food Coupons so help Soumya to decide the items he should buy and finish the coupones. He will enter three number and find that whether he will get the discount or not.Speedy Kings
http://www.anyforum.in/question/corejava/programming/Speedy-Kings/810
Speedy kings are a racing group. Their leader John owns a Suzuki Hayabusa which has a maximum speed of 300 kmph. The leader of the rival group, Ranson owns a Ducati whose maximum speed is 280 kmph. John makes n rounds of 10km track. How much time(in minutes) will Ranson take to complete the same distance covered by John. Take the value of n as input from the user. Sample Input: 4 Sample Output: 8 .Fabonacci Series
http://www.anyforum.in/question/corejava/programming/Fabonacci-Series/809
David is a student of Computer Science and he need your Java skill to solve the problem of space separeted Fibonacci Numbers upto "N" term. If the N is not greater than 0 then print "Invalid input". Sample Intput: 10 Sample Output: 0 1 1 2 3 5 8 13 21 34 NOTE:- For accepting input use Scanner class.Reverse Jalaj number
http://www.anyforum.in/question/corejava/programming/Reverse-Jalaj-number/806
Jalaj was deeply studying in the afternoon and came across a concept called as reverse of a number. Hearing this for the first time, he was eager to learn and searched the Internet and decided to design a program, which can reverse any number. But, he could not convert his logic into code. So, he is now requesting you to design a very efficient method to reverse a number and print it as a EVEN or ODD, as the case may be. Miracle Cubes-30 min
http://www.anyforum.in/question/corejava/programming/Miracle-Cubes-30-min/804
Miracle Cube are numbers whose cube root is equal to the sum of its own digits. Write a program which will print the number of distinct non miracle cubes in the series of n numbers(where n is a user specified integer such that 0 lessthan n and n less than equals 50) Cozy number
http://www.anyforum.in/question/corejava/programming/Cozy-number/802
Find the given number N is cozy number or not. Input Constrains: Note: If input is not according to the constrains then output should be InputValueOutOfBoundryException Input 1: 6 output 1: 6 is a cozy number. Input 2: 210 output 2: 210 is not a cozy number. Input: -1 output: InputValueOutOfBoundryException Explanation: The proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110. Summation of all the divisor of 220 is 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; Now Summation of all the divisor of 284 is 220 therefore 220 is cozy number. SumNum in java
http://www.anyforum.in/question/corejava/programming/SumNum-in-java/801
Write a program to sum up all the positive numbers from n1 to n2, both inclusive and store it in a variable n. Your program should print the message "The sum of t numbers is " followed by the sum of given numbers Sample input: 2 10 Sample output: The sum of 9 numbers is 54Java Program to print this output using For loop
http://www.anyforum.in/question/corejava/programming/Java-Program-to-print-this-output-using-For-loop/797
Do a program in java to print this output. Answering Protocol in JAVA
http://www.anyforum.in/question/corejava/programming/Answering-Protocol-in-JAVA/794
You have an answering protocol when your mobile rings. 1. You never answer it when you are sleeping. 2. You answer it in the morning, only if your mother calls. 3. All other times you answer it. Write a Java program to decide whether you must answer the phone call or not. Input specification: 3 Boolean variables - isMom, isAsleep, isMorning Output specification: true if you answer, false if you do not answer. Sample input: false false false Sample output: trueSum of N ODD and EVEN numbers
http://www.anyforum.in/question/corejava/programming/Sum-of-N-ODD-and-EVEN-numbers/793
Pranav is a genious student in electronics but his Java is not so good. One day he wanted to know the sum of all the ODD and EVEN numbers between the range of 1 to ´N´. That is why he is asking your help. Write a java program to find the sum of ODD and EVEN numbers. If ´N´ is invalid then print ´Invalid input´. Sample input:- 3 Sample Output:- Sum of EVEN Numbers:- 2 Sum of ODD Numbers:- 4 Mobile Key-Pad in Java
http://www.anyforum.in/question/corejava/programming/Mobile-Key-Pad-in-Java/791
On a Mobile Key Pad the letters are mapped to the digits like following : ABC(2), DEF(3), GHI(4), JKL(5), MNO(6), PQRS(7), TUV(8), WXYZ(9) Write a program which will take a String as input and the output will be a sequence of digits according to the mentioned mapping. Note: You can assume that the input will not contain more than 10 letters and all the letters will be in upper case. Input Specification: Input will contain one line containing string in uppercase without spaces. Output: Output should contain single line specifying the numbers corresponding to the characters in the string. Sample Input : JAVA, Sample Output: 5282Print the series of prime numbers in java
http://www.anyforum.in/question/corejava/programming/Print-the-series-of-prime-numbers-in-java/788
Write a java program to print a comma (,) separated series of prime numbers between M and N including. Check if the inputs are correct or not if not then print Invalid input. Sample input:- 1 10 Sample output:- 2,3,5,7 Input Explanation:- First number 1 is the starting point of the series and last number 10 is the tail of the series.java program
http://www.anyforum.in/question/corejava/programming/java-program/786
Ankit is going to preform today in Ignite, as he usually forgets his instruments so you need to check whether he will perform or not using a Java Program as he can understand JAVA only. Find area of a circle
http://www.anyforum.in/question/corejava/programming/Find-area-of-a-circle/785
Arjit wants to create a wall bisecting a circular ground. Write a program which takes the area of the ground in sq. units as input and gives the length of the wall(diameter) as the output. Find the diameter of the circle for any given area till 4 decimal places. Sample Input: 50.23 Sample Output: 7.9992 Hint: To find square root use Math.sqrt() and 3.14 as value of Pi. For rounding it upto 4 decimal places make use of DecimalFormat class of java.text package. Sample double d=123.456546; DecimalFormat f=new DecimalFormat("##.####"); System.out.println(f.format(d));Dinesh revenge
http://www.anyforum.in/question/corejava/programming/Dinesh-revenge/778
Dinesh has been bullied enough all his life and now he seeks revenge. His first victim being Deepak, obviously! He found on e question to take revenge from deepak, but without knowing the answers of the question he would not be able to know whether deepak´s answers are correct or not. The question consists of two numbers, a and b, and the answer to it is the sum of digits of a^b (i.e - a raise to the power b). Help him to find the answers so that he can take revenge from deepak. (You should be able to write the solution for this problem in 25 minutes) Input: First line contains the number of test cases t. After that t lines follow each containing a pair of space separated integers i.e. a and b. Output: For each test case, you need to print the sum of digits in a^b. Sample Input : 2 2 10 3 3 Sample Output : 7 9 Explanation Consider the first test case. 2^10 = 1024 Now, 1 + 0 + 2 + 4 = 7 So, output for this test case is 7. Calculate loss and loss percentage
http://www.anyforum.in/question/corejava/programming/Calculate-loss-and-loss-percentage/775
Jalaj purchased a table for Rs.200.4 and due to some scratches on its top he had to sell it for Rs.176.5. Find his loss and loss%.Sum of even numbers
http://www.anyforum.in/question/corejava/programming/Sum-of-even-numbers/774
Write a java program to calculate sum of all even numbers between 1 to n. Sum of n numbers
http://www.anyforum.in/question/corejava/programming/Sum-of-n-numbers/771
Write a program to sum up all the positive numbers from n1 to n2, both inclusive and store it in a variable n. Your program should print the message "The sum of n2 - n1 numbers is " followed by the value of the sum (n).Please give program for printing following pattern
http://www.anyforum.in/question/corejava/programming/Please-give-program-for-printing-following-pattern/750
Please give program for printing E pattern.Temperatures
http://www.anyforum.in/question/corejava/programming/Temperatures/734
Given two temperatures, print ´true´ if one is less than 0 and the other is greater than 100.Else print ´false´ icyHot(120, -1)--> true icyHot(2, 120) --> false, Expected input: 120 -1, Expected output: true.How to write the logic for the following series in java?
http://www.anyforum.in/question/corejava/programming/How-to-write-the-logic-for-the-following-series-in-java/719
write the logic for the following series in java.Explain the result of the following java code?
http://www.anyforum.in/question/corejava/programming/Explain-the-result-of-the-following-java-code/705
Explain the result of the following java code?Which for loop will be faster?
http://www.anyforum.in/question/programming/basics/Which-for-loop-will-be-faster/703
Which for loop will be faster? Print the sum of following numbers
http://www.anyforum.in/question/corejava/programming/Print-the-sum-of-following-numbers/698
Write a program in Java to print the sum of all numbers from 50 to 250 (inclusive of 50 and 250) that are multiples of 3 and not divisible by 9.Super man problem
http://www.anyforum.in/question/corejava/programming/Super-man-problem/697
Superman has laser powerd eyes. Laser rays from his eyes can melt iron. The temperature of the laser rays is measured in Fahrenheit (°F).Write a programme to convert the temperature from Fahrenheit (°F) to Celsius (°C).Accept the value of Fahrenheit from user. Hint: (°F - 32) x (5div9) = °C Sample input: 98 Sample Output: 36.666666666666664How to print following series in java?
http://www.anyforum.in/question/corejava/programming/How-to-print-following-series-in-java/688
How to print following alphabet pyramid series in java?How to generate OTP using java?
http://www.anyforum.in/question/corejava/programming/How-to-generate-OTP-using-java/675
How to generate the OTP using java in server side and how the server verify the client submitted OTP. Lucky 13 in java
http://www.anyforum.in/question/corejava/programming/Lucky-13-in-java/667
Write a program to print all numbers from 1 to 30. If the number is a multiple of 13, print the string "lucky number" instead of the number.Calculate Speed
http://www.anyforum.in/question/corejava/programming/Calculate-Speed/665
Write a program which will take time(hour) and distance(km) as parameters and print the speed in kmph. Can we use enum in switch statement?
http://www.anyforum.in/question/programming/enums/Can-we-use-enum-in-switch-statement/659
could you plz explain me with sample example. Is number evenly divides self
http://www.anyforum.in/question/java/programming/Is-number-evenly-divides-self/657
We say that a positive int divides itself if every digit in the number divides into the number evenly. So for example 128 divides itself since 1, 2, and 8 all divide into 128 evenly.Write the code for print the following series
http://www.anyforum.in/question/corejava/programming/Write-the-code-for-print-the-following-series/656
Write the code for print the pyramid series.Yoga Reminder
http://www.anyforum.in/question/programming/basics/Yoga-Reminder/653
A Yoga enthusiast sets a reminder in her calendar to alert her at practice time. The alert is set to "7:00" on weekdays and "10:00" on weekends (Saturdays and Sundays). While on holiday however, the alert is set to "10:00" on weekdays and is "off" on weekends. Fill in the method to return a string of the form "7:00" indicating when the alert should ring. Encode the day of the week as 0=Sun, 1=Mon, 2=Tue, ...6=Sat. holiday is a boolean variable indicating if she is on holiday. Is Number evenly divisible?
http://www.anyforum.in/question/programming/basics/Is-Number-evenly-divisible/650
We´ll say that a positive int divides itself if every digit in the number divides into the number evenly. So for example 128 divides itself since 1, 2, and 8 all divide into 128 evenly. We´ll say that 0 does not divide into anything evenly, so no number with a 0 digit divides itself.Explain casting in below case?
http://www.anyforum.in/question/corejava/programming/Explain-casting-in-below-case/647
Explain casting in below case?Identifier expected why it so?
http://www.anyforum.in/question/programming/basics/Identifier-expected-why-it-so/646
Identifier expected why it so?calculate the addition and subtraction of two given matrices
http://www.anyforum.in/question/corejava/programming/calculate-the-addition-and-subtraction-of-two-given-matrices/634
Write a Program to calculate the addition and subtraction of two given matrices(3x3). Calculate your account balance after an attempted transaction
http://www.anyforum.in/question/programming/basics/Calculate-your-account-balance-after-an-attempted-transaction/625
You would like to withdraw Rs. X from an ATM. The ATM stores only Rs. 100 notes and thus accepts the transaction if X is a multiple of 100. Ofcourse, your account balance must have enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges Rs. 5 Calculate your account balance after an attempted transaction. Error evaluation
http://www.anyforum.in/question/programming/basics/Error-evaluation/624
An error x% in excess is made while measuring the side of a square. Write a Java program which will take x as input and prints the percentage of error in the calculated area of the square. Find if we are in trouble
http://www.anyforum.in/question/programming/basics/Find-if-we-are-in-trouble/623
We have two monkeys, a and b, and the parameters aSmile and bSmile indicate if each is smiling. We are in trouble if they are both smiling or if neither of them is smiling. Return true if we are in trouble.Differentiate lightweight process and heavyweight process in multi-threading?
http://www.anyforum.in/question/programming/multithreading/Differentiate-lightweight-process-and-heavyweight-process-in-multi-threading/622
I need a java code. Please provide the code for above mention query. Calculate the time to reach the destination
http://www.anyforum.in/question/programming/basics/Calculate-the-time-to-reach-the-destination/614
Sunday evening 8 PLs were planing for a walk to Nilankarai beach from Thoraipakkam. As they were late they were not sure about whether they should go or not. Suddenly Suman started calculating the distance and the expected time of arrival(ETA) to the beach. Help them quickly to find the minimum time to reach the destination. calculate the minimum and maximum possible sum
http://www.anyforum.in/question/programming/basics/calculate-the-minimum-and-maximum-possible-sum/613
Big P is fairly good in mathematics. Teacher has asked her to add two numbers. Now , Ritika has a problem that she sometimes writes a ´6´ as a ´4´ and vice versa. Given two numbers, A and B, calculate the minimum and the maximum sum Ritika could possibly get. Richie Rich Vivekanand
http://www.anyforum.in/question/programming/basics/Richie-Rich-Vivekanand/610
After working in TCS vivek became very rich. Now he wants to buy a new flat. The flat cost X rupees at a rate of Y rupees/sqrft. Vivek wants you to calculate the price of his new flat.Can you determine the acceleration of the car?
http://www.anyforum.in/question/programming/basics/Can-you-determine-the-acceleration-of-the-car/609
David brought a Ducatty recently. And now he is learning to drive that car. As he is
concentrating only on driving, that is why he asked your help to monitor his driving skills. He starts the car from rest and accelerates uniformly over a time of T seconds for a distance of D m. Can you determine the acceleration of the car?WAP which prints character position in a sentence
http://www.anyforum.in/question/corejava/programming/WAP-which-prints-character-position-in-a-sentence/608
Write a java program which takes a character and a sentence as input. Print the position numbers where the character appears in that line. If the character does not appear in the sentence at all, print -1.write java program to solve linear expression
http://www.anyforum.in/question/corejava/programming/write-java-program-to-solve-linear-expression/607
Our sweetshop owner knows that we are working as software professionals. So, his response would always be like a programming problem. For example, if I go and ask him the price of a single piece of Mysore pak, he will say "if you buy four mysore paks and three laddus, it will cost you Rs. 52. But, if you buy five of each, then it will be Rs. 75". You will have then do the required arithmetic and get the price of one Mysore pak as Rs. 7 and the other one as 8. Write a program in Java to get the price of each piece, given all the six values. The input to your program will be six integers. Your program should output the price of each piece separated by a blank space.java program on trains
http://www.anyforum.in/question/corejava/programming/java-program-on-trains/606
Suppose two trains Shatabdi express and Rajdhani express of length 120 metres and 130 metres are moving in opposite directions at 200 mps and 3000 meter per min. Find the time taken by trains to cross each other. problem on bucket
http://www.anyforum.in/question/corejava/programming/problem-on-bucket/605
There are 5 buckets and 58 balls. Now, you have to equally distribute all balls into the buckets i.e. all buckets should contain same number of balls. If you have asked to put maximum number of balls into the buckets, then what will be number of remaining balls that can not be allocated?WAP to calculate sum of even digits present in an Integer
http://www.anyforum.in/question/corejava/programming/WAP-to-calculate-sum-of-even-digits-present-in-an-Integer/603
Write a java program to calculate sum of even digits present in an Integer. If your input is a negative number it should give an error message "Incorrect Input". Write a java program to simulate this game?
http://www.anyforum.in/question/corejava/programming/Write-a-java-program-to-simulate-this-game/602
The game of bus-bus is played by a set of people, who form a circle. One of the persons in the circle has to say 'one', the next person should say two and so on. Whenever a person gets a number, which is either divisible by seven or ends with seven, he/she should say 'Bus' instead of the number. If the number in turn is both visible by seven and ends with a seven, then 'BusBus' should be uttered. Any one who violates the rule is taken out of the circle and the game continues with the remaining persons. The last one remaining is the winner of the game. Write a program to simulate this game. Input to your program is n upto which the above rule should be followed. Test whether we can play game or not?
http://www.anyforum.in/question/corejava/programming/Test-whether-we-can-play-game-or-not/601
The number 6 is a truly great number. Take two integers a and b, print True if either one is 6. Or if their sum or difference is 6. If True then print "You can play with a and b" otherwise print "You can not play with a and b".Take two integers and do the following operations
http://www.anyforum.in/question/corejava/programming/Take-two-integers-and-do-the-following-operations/600
Take two integers, Check whether they are even or odd, if both are even or both odd, print the sum of their squares (a*a+b*b). Otherwise print the square of their sums (a+b)*(a+b). If any of the number is zero then print "Invalid Input".WAP that takes an integer input and print the name of the issuer?
http://www.anyforum.in/question/corejava/programming/WAP-that-takes-an-integer-input-and-print-the-name-of-the-issuer/599
Every credit card has a unique 16-digit number. The first few digits are called the issuer identification number (IIN). The following data specify the issuer and the corresponding IIN. Whenever two numbers are specified separated by a hyphen (like 5-10) against an issuer, it should be understood as a range: American Express 34 or 37, Diners Club 300-305, JCB 3528-3589, Master 51-55, Visa 4.Write a program that will take an integer input and print the name of the issuer. Find the sum of numbers which are multiples of 3 and not divisible by 9
http://www.anyforum.in/question/corejava/programming/Find-the-sum-of-numbers-which-are-multiples-of-3-and-not-divisible-by-9/598
Write a program in Java to print the sum of all numbers from n1 to n2 that are multiples of 3 and not divisible by 9. Sample input : 230 240 Sample output : 708 Program to find runrate
http://www.anyforum.in/question/corejava/programming/Program-to-find-runrate/597
In the first 10 overs of India Innings, the run rate was only 3.2. Find the required run rate in the remaining 40 overs to reach the target of 282 runs. Total overs : 50.Total balls in an over: 6.Run rate formula: total runs scored/total overs faced. NOTE: Answer should be upto two decimal places.Getting logical error
http://www.anyforum.in/question/corejava/programming/Getting-logical-error/596
On Christmas day, when you woke up, you saw that two big trucks with full of chocolates had arrived. Your mother told you that there are total 111304954 chocolates and your father told that one truck has 8320118 less chocolates than other. Write a program to calculate the number of chocolates in each truck. Print the bigger number first, then a space and then the smaller number.Write a java program for below problem
http://www.anyforum.in/question/corejava/programming/Write-a-java-program-for-below-problem/595
Subham loves panipuri so he decided to have panipuri in one evening. But as it was the month end he don't have enough cash with him and every two panipuri costs 1.50 rupees. Subham will enter the money he has and you have to find the maximum number of panipuri he can get. Before printing result please make sure. Subham has money or not if not then prompt him "you have no money". Write a java program to find the shortest path
http://www.anyforum.in/question/corejava/programming/Write-a-java-program-to-find-the-shortest-path/594
WAP to find the shortest pathHow to calculate the sum of odd numbers in a series?
http://www.anyforum.in/question/corejava/programming/How-to-calculate-the-sum-of-odd-numbers-in-a-series/592
Write a program that calculates the sum of odd terms of a given series. The input to your program is three integers a, d and l. They stand for the first, difference and the last term respectively of the series. Your program should output an integer that corresponds to the sum of alternating terms starting from the first term. java program to print pyramid of stars using for loop?
http://www.anyforum.in/question/corejava/programming/java-program-to-print-pyramid-of-stars-using-for-loop/589
java program to print pyramid of stars using for loop.Find the sum of cube of given set of integers
http://www.anyforum.in/question/programming/basics/Find-the-sum-of-cube-of-given-set-of-integers/588
Write a program to calculate the sum of cube of given set of integers.WAP for Producer Consumer problem
http://www.anyforum.in/question/programming/multithreading/WAP-for-Producer-Consumer-problem/579
Please give me code for Producer Consumer problem.Why it is printing same value even after four post increment?
http://www.anyforum.in/question/programming/basics/Why-it-is-printing-same-value-even-after-four-post-increment/577
how the output is 10 after 3 increment operators?How to find lucky number?
http://www.anyforum.in/question/corejava/programming/How-to-find-lucky-number/554
Write a java program to calculate the lucky number, It takes date of birth as input in format dd/MM/yyyy. and it'll give the one digit number by doing the sum of all the digits in DOB until we get the only one digit. It's the similar concept which we use at the time when we talk about the numerology.Why following code throws java.lang.StackOverflowError?
http://www.anyforum.in/question/programming/exception-handling/Why-following-code-throws-java.lang.StackOverflowError/551
why following code is throwing Exception in thread "main" java.lang.StackOverflowError.MarsRovers Problem
http://www.anyforum.in/question/programming/basics/MarsRovers-Problem/549
For a given rovers position x y d where x and y is the coordinates and d is the heading direction which could be E, W, N and S. Now for second input string which may contain L, R and M. L and R means turn 90 degree in left and right direction respectively. and M means shift one position forward in the current heading direction.How to find minimum number of coins for given amount?
http://www.anyforum.in/question/corejava/programming/How-to-find-minimum-number-of-coins-for-given-amount/546
We have a list of coins of rupees 100, 50, 20, 10, 5, 2, 1. Write a java program to find the minimum number of coins for a given amount.How to delete alternate element from list in circular way?
http://www.anyforum.in/question/programming/collection/How-to-delete-alternate-element-from-list-in-circular-way/545
Let's consider n people sitting around a circular table and we have to pick alternate starting from 1 till only 1 remains on the table. Write a java program to solve the above problem.How can we make a java class immutable?
http://www.anyforum.in/question/corejava/programming/How-can-we-make-a-java-class-immutable/543
How can we make a java class immutable?How to print the series of palindrome numbers upto 500?
http://www.anyforum.in/question/corejava/programming/How-to-print-the-series-of-palindrome-numbers-upto-500/539
I want to print the series of all palindrome numbers upto 500 in java.find second largest number in an array in efficient way in java
http://www.anyforum.in/question/programming/array/find-second-largest-number-in-an-array-in-efficient-way-in-java/534
find second largest number in an array in efficient way in javaExplain the output of following code
http://www.anyforum.in/question/programming/basics/Explain-the-output-of-following-code/530
int z=++y *(y++ +5); System.out.println(y);How to find that a given number is a factorial of which number?
http://www.anyforum.in/question/corejava/programming/How-to-find-that-a-given-number-is-a-factorial-of-which-number/487
Please write a java program which determines that a given number is the factorial of which number and if it's not then show in the output as it's not a factorial but it's closer to factorial of this number.How to find the common words in each input line?
http://www.anyforum.in/question/java/programming/How-to-find-the-common-words-in-each-input-line/482
I want to find the common word in each input line. Please give me a java code to find common word in each line.How to print the square root of an input series elements in java?
http://www.anyforum.in/question/java/programming/How-to-print-the-square-root-of-an-input-series-elements-in-java/475
Please write a program to print the output for the input series as input if we enter 1, 4 9, 16, ....100. then output must be 1^2, 2^2, 3^2,....10^2.How to print the sequence of odd and even numbers from input data?
http://www.anyforum.in/question/corejava/programming/How-to-print-the-sequence-of-odd-and-even-numbers-from-input-data/474
Please write a java program to print the sequence of odd and even numbers from input data.How to print 100 random numbers at a time from 1000 whole numbers?
http://www.anyforum.in/question/corejava/programming/How-to-print-100-random-numbers-at-a-time-from-1000-whole-numbers/465
Please give me a java code snippet to print 100 random numbers from 1000 total numbers.How to find given number is even or odd without using loop and If statement?
http://www.anyforum.in/question/programming/basics/How-to-find-given-number-is-even-or-odd-without-using-loop-and-If-statement/458
Please give me a sample code to find given number is even or odd without using loop and If statement.How to find largest and smallest number in a group of numbers without using array?
http://www.anyforum.in/question/programming/basics/How-to-find-largest-and-smallest-number-in-a-group-of-numbers-without-using-array/453
I want to find the largest and smallest number in a group of numbers without using array. Please give me sample code.How to find prime numbers without using modulus operator?
http://www.anyforum.in/question/programming/basics/How-to-find-prime-numbers-without-using-modulus-operator/452
Kindly give me sample code snippet to find the prime numbers without modulus operator.what will happen if we give return type to constructor?
http://www.anyforum.in/question/programming/OOPs/what-will-happen-if-we-give-return-type-to-constructor/450
how to give a return type to a constructor and what will happen?Why variable value is not incrementing?
http://www.anyforum.in/question/programming/basics/Why-variable-value-is-not-incrementing/428
What is the o/p and why? why it is not storing incremented value. It´s printing 10 all times.Write a program to print the following series
http://www.anyforum.in/question/corejava/programming/Write-a-program-to-print-the-following-series/413
I want to print the series like 1,-2,6,-15,31,-56. Please write a java program to print the series upto given no of terms.Find out Series based on given numbers using Java
http://www.anyforum.in/question/corejava/programming/Find-out-Series-based-on-given-numbers-using-Java/412
If my input is 1,1,2,3,5.... or 2, 4, 8, 16... or 2,3,5,7,11..then out put should be shown : series is Fibonacci series or geometry series or Prime Number series and find out next element in the slot. if i give other than these should give "Not find series ".Please can any one solve this problem.difference between procedural and object oriented language
http://www.anyforum.in/question/programming/basics/difference-between-procedural-and-object-oriented-language/411
Please explain the difference between procedural and object oriented language.Program to convert a number in words to integer
http://www.anyforum.in/question/java/programming/Program-to-convert-a-number-in-words-to-integer/404
Please give me sample code to convert a number in words to integer value.Can we use do while loop with switch case?
http://www.anyforum.in/question/programming/switch-case/Can-we-use-do-while-loop-with-switch-case/402
Please explain with example of do-while loop with switch case statement.Difference between business logic and presentation logic?
http://www.anyforum.in/question/programming/basics/Difference-between-business-logic-and-presentation-logic/394
Explain the difference between business logic and presentation logic.Write a Java Program to read a number and display it in words
http://www.anyforum.in/question/java/programming/Write-a-Java-Program-to-read-a-number-and-display-it-in-words/385
Please explain in simple logic. e.g: 23456 display like Twenty Three Thousand Four Hundred Fifty Six.why the following program is giving output 34?
http://www.anyforum.in/question/corejava/programming/why-the-following-program-is-giving-output-34/383
why System.out.println(0x10+10+010) is giving 34 as output?Why i am getting possible loss of precision in factorial program?
http://www.anyforum.in/question/programming/basics/Why-i-am-getting-possible-loss-of-precision-in-factorial-program/371
In above program i am getting possible loss of precision compile time error. please help me. Why i am getting negative value while printing factorial(17)?
http://www.anyforum.in/question/corejava/programming/Why-i-am-getting-negative-value-while-printing-factorial(17)/368
I am using following code to calculate the factorial of a number. But i am getting negative value.Difference between Exception and Error
http://www.anyforum.in/question/programming/basics/Difference-between-Exception-and-Error/360
Please differentiate exception and error in java.Program to find what should be added in a given number to make it perfect square
http://www.anyforum.in/question/programming/basics/Program-to-find-what-should-be-added-in-a-given-number-to-make-it-perfect-square/353
Write a java program to find out what should be added in an input number to make it a perfect square.what is dangling pointer in java?
http://www.anyforum.in/question/programming/basics/what-is-dangling-pointer-in-java/348
Explain dangling pointer in java with example.what is the main difference between include and import statement?
http://www.anyforum.in/question/programming/basics/what-is-the-main-difference-between-include-and-import-statement/339
Kindly Explain the difference between include and import statement.How to print the numbers from 0 to 100 without using for loop or recursion?
http://www.anyforum.in/question/corejava/programming/How-to-print-the-numbers-from-0-to-100-without-using-for-loop-or-recursion/334
Please give me java source code to print the numbers from 0 to 100 without using for loop or recursion.what is difference among size,length and capacity in programming?
http://www.anyforum.in/question/programming/basics/what-is-difference-among-size,length-and-capacity-in-programming/326
i need to know the exact difference between these according to programming language with example.Java supports pass by value or pass by reference or both?
http://www.anyforum.in/question/java/programming/Java-supports-pass-by-value-or-pass-by-reference-or-both/310
Please explain java supports pass by value or pass by reference or both.write a program to print triangle pattern with two characters?
http://www.anyforum.in/question/corejava/programming/write-a-program-to-print-triangle-pattern-with-two-characters/308
Please give me java source code to print triangle pattern with two characters?why int=012 works like 10?
http://www.anyforum.in/question/programming/basics/why-int=012-works-like-10/280
Please describe that how int i=012 works like 10.when should we use typecasting?
http://www.anyforum.in/question/programming/basics/when-should-we-use-typecasting/252
Please explain when should we go for typecasting in java.Is there any Common Compiler for all languages ?
http://www.anyforum.in/question/programming/knowledge/Is-there-any-Common-Compiler-for-all-languages/250
Please help me about a common compiler for all programming languages.Write a java program to display the days in a week
http://www.anyforum.in/question/java/programming/Write-a-java-program-to-display-the-days-in-a-week/248
write a program in java to display days in a week using multiple selection.what is difference between float and double?
http://www.anyforum.in/question/programming/basics/what-is-difference-between-float-and-double/246
which one is flexible and why float have more roundtrips. and which one should we use?Program to find out the sum of odd numbers
http://www.anyforum.in/question/corejava/programming/Program-to-find-out-the-sum-of-odd-numbers/242
write a java program to find the sum of odd numbers from 3 to 200.