Link to download mysql jdbc driver
http://www.java2s.com/Code/Jar/c/Downloadcommysqljdbc515jar.htm
Link to download mysql jdbc driver
http://www.java2s.com/Code/Jar/c/Downloadcommysqljdbc515jar.htm
5+7=12
)
WAP to read a number and print all numbers from 1 to that number
Input: Enter a number: 5
Output:
1
2
3
4
5
WAP to read number and print all even numbers from 1 to that number
Input: Enter a number: 5
Output:
2
4
WAP to print all numbers from 1 to 10 using while, for, and do-while loop
WAP to read a number and find sum of all numbers from 1 to that number
Input: Enter a number: 5
Output: 1 + 2 + 3 + 4 + 5 = 15
WAP to read a number and find factorial of that number
Input: Enter a number: 5
Output: 1 * 2 * 3 * 4 * 5 = 120
WAP to read a number and check if it is a prime number or not
Input: Enter a number: 5
Output: 5 is a prime number
WAP to print all prime numbers in range from 1 to 100
Output:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97
WAP to print first 10 Fibonacci numbers
Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
WAP to print table of number in following format using 1 for loop
Input: Enter a number: 5
Output:
5 * 1 = 5 5 * 10 = 50
5 * 2 = 10 5 * 9 = 45
5 * 3 = 15 5 * 8 = 40
5 * 4 = 20 5 * 7 = 35
5 * 5 = 25 5 * 6 = 30
5 * 6 = 30 5 * 5 = 25
5 * 7 = 35 5 * 4 = 20
5 * 8 = 40 5 * 3 = 15
5 * 9 = 45 5 * 2 = 10
5 * 10 = 50 5 * 1 = 5
WAP to create random jackpot number and take input from user to guess the number
Based on level, the attempt to guess the number should change:
Easy – 20 attempts
Medium – 10 attempts
Difficult – 5 attempts
WAP to execute Fizz Buzz Problem / Print number 1 to 100
If number is divisible by 3 then print Fizz
If number is divisible by 5 then print Buzz
If number is divisible by both 3 and 5 then print Fizz Buzz
Basic WAP (Write A Program) Questions
Input:
Enter a number: 5
Output:
Number 5 is odd
Input:
Enter number 1: 55
Enter number 2: 45
Output:
Last digits of 55 and 45 are same
Input:
Enter value for angle a: 50
Enter value for angle b: 60
Enter value for angle c: 70
Output:
Triangle can be formed
Input:
Enter value for angle a: 60
Enter value for angle b: 60
Enter value for angle c: 60
Output:
Triangle is equilateral triangle
Input:
Enter marks for maths: 50
Enter marks for science: 50
Enter marks for history: 50
Enter marks for english: 50
Enter marks for marathi: 50
Output:
Total Marks: 250
Percentage: 50%
Student is passed
Input:
Enter number 1: 50
Enter number 2: 60
Output:
60 is greater than 50
Input:
Enter number 1: 50
Enter number 2: 60
Enter number 3: 70
Output:
70 is greater than 50 and 60
Input:
Enter a 3 digit number: 153
Output:
Success: Sum of cube of 153 is 153
Input:
Enter number 1: 50
Enter number 2: 60
Enter number 3: 70
Output:
Last digits of 50, 60 and 70 are same
Input:
Enter a number: 121
Output:
121 is palindrome number
Input:
Enter marks for maths: 50
Enter marks for science: 50
Enter marks for history: 50
Enter marks for english: 50
Enter marks for marathi: 50
Output:
Total Marks: 250
Percentage: 50%
Student is passed
Input:
Enter value for angle a: 45
Enter value for angle b: 45
Enter value for angle c: 90
Output:
Triangle can be formed
The triangle is right angled triangle
Input:
Enter gender M or F: M
Enter your age: 30
Output:
30 ka ho gaya ab to shadi kar le
Input:
Enter year: 2004
Output:
Year 2004 is a leap year
Salary Commission
<10000 10%
10000-20000 12%
>20000 15%
Input:
Enter Salary: 10000
Output:
Your commission is 1000 Rupees
Percentage Division
>=75 1st class with distinction
60-75 1st class
50-60 2nd class
40-50 3rd class
<40 Fail
Input:
Enter marks for maths: 75
Enter marks for science: 75
Enter marks for history: 75
Enter marks for english: 75
Enter marks for marathi: 75
Output:
Total Marks: 375
Percentage: 75%
Student passed with 1st class Distinction
Input:
Enter radius: 5
Output:
Area of circle is 78.5
Circumference of circle is 31.5
Input:
Enter number 1: 5
Enter number 2: 6
Enter number 3: 7
Output:
Mean of 5, 6 and 7 is 6
Input:
Enter number 1: 52
Enter number 2: 65
Output:
2 + 5 = 7
Input:
Enter a number: 1234
Output:
1 + 2 + 3 + 4 = 10
Input:
Enter radius: 5
Output:
Volume of sphere having radius 5 is 523.6
Input:
Enter a number: 123
Output:
1 + 2 + 3 = 6
Input:
Enter a number: 1234
Output:
Reverse of 1234 is 4321
Input:
Enter temperature in Celsius: 38
Output:
Temperature in Fahrenheit is 100.4
Input:
Enter length in inches: 20
Output:
20 inches is equal to 1 foot and 8 inches
Input:
Enter marks for Maths: 50
Enter marks for Science: 50
Enter marks for History: 50
Enter marks for English: 50
Enter marks for Marathi: 50
Output:
Total Marks: 250
Percentage: 50%
Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5
Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5
Input:
Enter length: 5
Enter breadth: 6
Enter height: 7
Output:
Volume of box is 210
Surface area of box is 214